DEV Community

Discussion on: How to empty an array in JavaScript

Collapse
 
jackydev profile image
JacKyDev

I think Not..
Its the Same result but the author used the existing Array in context and you create an complete new Array for context

Collapse
 
bias profile image
Tobias Nickel

yes, any just by doing so, the author introduce a implicit dependencies between components. Using the same array all over the and somewhere it get emptied will cause some nice side effects.

This will give you some fun debugging session.