2 ms·
Do you think Array.prototype.push() also has limited applications? It too mutates the source array, but must be the most commonly used Array method there is. An
by dumbo-octopus 2y ago
Do you think Array.prototype.push() also has limited applications? It too mutates the source array, but must be the most commonly used Array method there is. And the two combined make for a lovely FIFO.
Anyone is certainly free to use Array.prototype.slice() if they want a view.