Sending an anonymous function to the sort method, which returns the subtraction of the "z" property
var arr = [{z:2},{z:4},{z:5},{z:1},{z:3}]; arr.sort(function(a,b) {return az - bz});
above puts the numbers in z in the order of 1,2,3,4,5. To reverse the order, return "bz - az".
smileylauri
source share