var val = [2, 1, 4, 5]; val.forEach(function (name) { console.log(name); });