Skip to content

Instantly share code, notes, and snippets.

@Lucifier129
Last active May 17, 2016 06:47
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 Lucifier129/3dcc99e0ea2f8b0c90f636ce60ccc513 to your computer and use it in GitHub Desktop.
Save Lucifier129/3dcc99e0ea2f8b0c90f636ce60ccc513 to your computer and use it in GitHub Desktop.
JS Pop Quiz: How well do you know your functions?
// the array of functions
const fns = [
function () {
console.log(1)
},
function () {
console.log(2)
},
function () {
console.log(3)
}
]
// it's equal to (...args) => Function.prototype.call.call(Function.prototype.call, ...args)
const call = Function.prototype.call.bind(Function.prototype.call)
fns.forEach(call) // change this line if you like
// Expected console output should be
// 1
// 2
// 3
@AdrianGimenez
Copy link

joputa :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment