// Javascript function lazySort(list, callback) { var result = []; list.forEach(function(i) { setTimeout(function() { result.push(i); if(result.length == list.length) { callback(result); } }, i); }); } lazySort([4,5,7,1,2,4,5], alert); //javascript/6500