DEV Community

Discussion on: Modern JavaScript, 10 things you should be using, starting today

Collapse
 
andrewbridge profile image
Andrew Bridge

I was thinking exactly this.

Even better: with this approach, you can choose to merge elements into an pre-existing object which can help with keeping object references and reduces the need for the engine to garbage collect short-lived objects.

Feels like a better approach!