4 ms·
> Closure and function return function can be used as substitute So for every list you have an additional allocation for the add function. It obviously contin
by nonsense1234 6y ago
> Closure and function return function can be used as substitute
So for every list you have an additional allocation for the add function. It obviously continuously to get much worse as more "methods" are inevitably added. That's extremely inefficient for something that's used often and it's not something JavaScript engines can optimize away. The benefit is also extremely negligible since the closed over values are still implicit in the call to add.