Skip to main content
This topic has been closed for replies.

2 replies

mike_causer
Participating Frequently
July 19, 2012

CF10 ArraySort() also supports closures.

eg.

mike_causer
Participating Frequently
July 19, 2012

CF10 ArraySort() also supports closures.

eg.

(cfscript)

data = [ "d", "b", "a", "c" ];

arraySort( data, function( a, b ) {

    return compare( a, b );

} );

// data == [ "a", "b", "c", "d" ]

(/cfscript)

Known Participant
July 10, 2012

In ColdFusion 10, added support for passing in a comparator function. See: http://www.samfarmer.com/blog/index.cfm/2012/7/9/10-Little-Ones-The-New-Array-Features#c7CADF978-1517-8A12-49EF8BDF7714F5A5