get top items from json object

JavaScript
var top10 = data.sort(function(a, b) { return a.Variable1 < b.Variable1 ? 1 : -1; })
                .slice(0, 10);
Source

Also in JavaScript: