Skip to content

Instantly share code, notes, and snippets.

Created December 15, 2012 05:27

Revisions

  1. @invalid-email-address Anonymous created this gist Dec 15, 2012.
    9 changes: 9 additions & 0 deletions Function.prototype.within.js
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,9 @@
    Function.prototype.within = function (millis) {

    var that = this;

    return function () {
    var args = Array.prototype.slice.call(arguments); // if sinful present, slice(arguments)
    return window.setTimeout(that, millis, args);
    };
    };