DEV Community

Discussion on: 7 Tips to boost your productivity as a web developer 🚀

Collapse
 
mustapha profile image
Mustapha Aouas • Edited

Also, because the array destructuring uses the iteration protocol, we can't destructure a null array:

a = null;
[...a]; // throws an error
{...a}; // works fine

About the performance considerations, do you have some benchmarks?

I tried a simple array destructuring for pushing values to an array, and it's faster than the push method: jsben.ch/IFmIz