DEV Community

Discussion on: Essential Vanilla JavaScript Functions

Collapse
 
eerk profile image
eerk

This, and you can even use the ...spread operator instead of concat, to create a new array from an existing one.
The above functions are translated a bit too literally from PHP, or perhaps the intention was to make them work for ES5 / lower?