Created
April 28, 2017 21:32
-
-
Save anonymous/e0b7d81b1372c75d9bbb5191569c6cf4 to your computer and use it in GitHub Desktop.
TryCF Gist
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<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