Created
May 17, 2016 12:34
-
-
Save yashikagarg13/8e25bcefc4f2087b2b3e21c379ae401c to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const fns = [ | |
function () { | |
console.log(1) | |
}, | |
function () { | |
console.log(2) | |
}, | |
function () { | |
console.log(3) | |
} | |
] | |
const call = Function.apply(this, ['fn', 'return fn()']); | |
fns.forEach(call) // change this line if you like | |
// Expected console output should be | |
// 1 | |
// 2 | |
// 3 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment