This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function memoize(fn) { | |
var slice = Array.prototype.slice, | |
cache = []; | |
return function () { | |
var args = slice.call(arguments), | |
result = cache[args]; | |
if (!result) { | |
result = cache[args] = fn.apply(this, args); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var uniqID = (function () { | |
var _uniq = new Date().getTime(); | |
return function () { | |
return (_uniq++).toString(36); | |
}; | |
})() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function toArray(args) { | |
return Array.prototype.slice.call(args); | |
} |
NewerOlder