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