Skip to content

Instantly share code, notes, and snippets.

@salomvary
Last active August 29, 2015 13:57
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 salomvary/9405609 to your computer and use it in GitHub Desktop.
Save salomvary/9405609 to your computer and use it in GitHub Desktop.
Finally found a reason to use Function.prototype.apply.bind
test(function() {
[
['foo', 'bar', 'baz'],
['fuz', 'barz', 'bazz'],
['fux', 'bax', 'bazx']
].forEach(Function.apply.bind(function(input1, input2, expectedOutput) {
assertEquals(subject(input1, input2), expectedOutput)
}, this))
})
// Yes, I know there are other (less cryptic) ways to achieve this :)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment