Created
July 16, 2016 06:31
-
-
Save sstur/67ad8254fd0bf2794ad5455ae025bd55 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
// ES5 | |
var getBound = Function.prototype.apply.bind(Function.prototype.bind) | |
function createDate() { | |
for (var i = 0, length = arguments.length, args = new Array(length + 1); i < length; i++) { | |
args[i + 1] = arguments[i]; | |
} | |
var BoundDate = getBound(Date, args); | |
return new BoundDate(); | |
} | |
// createDate(2010, 0, 1); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment