Skip to content

Instantly share code, notes, and snippets.

@hkjpotato
Created April 8, 2017 02:52
Show Gist options
  • Save hkjpotato/3b3b74de2c44c9aab7464a55331d4a4a to your computer and use it in GitHub Desktop.
Save hkjpotato/3b3b74de2c44c9aab7464a55331d4a4a to your computer and use it in GitHub Desktop.
function fn2() {
var preset = Array.prototype.slice.call(arguments);
/*
originally:
return fn.bind(null, ...arguments);
*/
return function helper() {
var added = Array.prototype.slice.call(arguments);
return fn2.apply(null, [...preset, ...added]); //for simplity, use es6
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment