function forEach (array, fn) { for (var i = 0, ln = array.length; i < ln; ++i) { fn(array[i], i); } } forEach([1,2,3], function (v) {console.log(v);})
[1, 2, 3].forEach(function (v) {console.log(v);})