Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save trycf/29d51928e2da5469117ba7924ab75be5 to your computer and use it in GitHub Desktop.
Save trycf/29d51928e2da5469117ba7924ab75be5 to your computer and use it in GitHub Desktop.
TryCF Gist
<cfscript>
a = {
"middle": 5,
"last": 10,
"first": 1
};
x = structSort(a, 'numeric', 'asc');
writeDump( x );
/*
expect : [ 'first', 'middle', 'last' ]
boxlang : [ 'first', 'last', 'middle' ]
*/
a = {
20: 5,
10: 10,
30: 1
};
x = structSort(a, 'numeric', 'asc');
writeDump( x );
/*
expect : [ '30', '20', '10' ]
boxlang : [ '10', '20', '30' ]
*/
</cfscript>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment