Skip to content

Instantly share code, notes, and snippets.

View blackboxx's full-sized avatar

Dmitry Yudin blackboxx

View GitHub Profile
var people=[{name:'Alex',age:12},{name:'Eva',age:11}]
function compare(a,b) {
if (a.age < b.age)
return -1;
if (a.age > b.age)
return 1;
return 0;
}
people.sort(compare);