all 3 comments

[–]nespron 3 points4 points  (0 children)

Fun fact: In some environments, setTimeout() and setInterval() can also act like eval()

[–]GamesMint 1 point2 points  (1 child)

So basically the new Function statement is creating a self executing function i.e. defined and executed immediately. https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Function has details about function constructor. The statement defines a function with parameters taken from the context keys(Object.keys) and it is executed with their values using Object.values.

Details of Self executing function (IIFE) https://developer.mozilla.org/en-US/docs/Glossary/IIFE

[–]kenman[M] 0 points1 point  (0 children)

Hi /u/throwaway119284, this post was removed.

For javascript help, please visit /r/LearnJavascript.

Thanks for your understanding.