The World's Most Misunderstood Programming Language
var a = [ {n: 1, str: 'first'}, {n: 2, str: 'stable check 1'}, {n: 2, str: 'stable check 2'}, {n: 3, str: 'last'} ]; a.sort(function(a, b) { return a.n - b.n; });