Skip to content

Instantly share code, notes, and snippets.

@sstur
Created July 16, 2016 06:31
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sstur/67ad8254fd0bf2794ad5455ae025bd55 to your computer and use it in GitHub Desktop.
Save sstur/67ad8254fd0bf2794ad5455ae025bd55 to your computer and use it in GitHub Desktop.
// 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