Home
My Highlights
Discover
Sign up
The "new Function" syntax
javascript.info
But new Function allows to turn any string into a function. The major difference from other ways we’ve seen is that the function is created literally from a string, that is passed at run time. But when a function is created using new Function, its [[Environment]] is set to reference not the current
6 Users
0 Comments
21 Highlights
0 Notes
Top Highlights
But new Function allows to turn any string into a function.
The major difference from other ways we’ve seen is that the function is created literally from a string, that is passed at run time.
But when a function is created using new Function, its [[Environment]] is set to reference not the current Lexical Environment, but the global one.
If new Function had access to outer variables, it would have problems with minifiers.
For historical reasons, arguments can also be given as a comma-separated list.
Domain
javascript.info
Ready to highlight and find good content?
Glasp is a social web highlighter that people can highlight and organize quotes and thoughts from the web, and access other like-minded people’s learning.
Start Highlighting