3 ms·
My tenuous understanding of the ECMAScript spec would suggest that a new execution context and associated activation object + scope chain is created each time
by enjo 14y ago
My tenuous understanding of the ECMAScript spec would suggest that a new execution context and associated activation object + scope chain is created each time that function is invoked. Since this is a closure, the execution context and associated objects have to wait to be garbage collected.
So you're going to see an increase in memory with each function call until the garbage collector kicks in.
So while the function definition is a literal, the execution most definitely has a cost associated with it.