News for hackers. Stuff that matters.
Re:The use of `class` for things that should be simple free ... by nonsense1234 on Thursday May 28, 2020 @12:47PM (#23339452)
> 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.

There are no comments on this comment yet.