Skip to content

Instantly share code, notes, and snippets.

@hkjpotato
Last active September 27, 2017 00:40
Show Gist options
  • Save hkjpotato/1d8a89c4833741c061f7745dd7ac84e6 to your computer and use it in GitHub Desktop.
Save hkjpotato/1d8a89c4833741c061f7745dd7ac84e6 to your computer and use it in GitHub Desktop.
var numOfRequiredArguments = 5;
var fn = function() {
if (arguments.length < numOfRequiredArguments) {
return fn.bind(null, ...arguments);
} else {
console.log('we already collect 5 arguments: ', [...arguments]);
return null;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment