Last active
August 4, 2019 13:01
-
-
Save hoangtranson/52d3bc8e9cafaea6564197d9e094b936 to your computer and use it in GitHub Desktop.
create function by Function constructor
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 sum = new Function('a', 'b', 'return a + b'); | |
console.log(sum(2, 6)); | |
// expected output: 8 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment