Skip to content

Instantly share code, notes, and snippets.

Created April 28, 2017 21:32
Show Gist options
  • Save anonymous/e0b7d81b1372c75d9bbb5191569c6cf4 to your computer and use it in GitHub Desktop.
Save anonymous/e0b7d81b1372c75d9bbb5191569c6cf4 to your computer and use it in GitHub Desktop.
TryCF Gist
<cfscript>
myjson = '[{"json:order":"6","json:type":"boolean","name":"active","type":"any"},{"json:order":"5","json:type":"number","name":"distributorID","type":"any"},{"json:order":"4","json:type":"string","name":"familyName","type":"any"},{"json:order":"3","json:type":"string","name":"firstName","type":"any","json:column":"strFirstName"},{"json:order":"1","json:type":"number","name":"ID","type":"any"},{"json:order":"2","json:type":"string","name":"title","type":"any","json:serializable":"false"}]';
myarray = deserializejson( myjson );
writeDump(myarray);
myarray.sort(function(e1, e2){
return e1["json:order"] - e2["json:order"];
});
writedump( myarray );
</cfscript>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment