window.SetTimeout = function (callback, millisec, param) { var args = Array.prototype.slice.call(arguments, 2); return setTimeout(function () { callback.apply(null, args); }, millisec); }; for (var i = 0; i < 5; i++) { SetTimeout(function (a) { console.log(a.v); }, 1000, { "v": i }); }