Re:What’s New in ES2019
by Ajedi32 on Tuesday July 30, 2019 @10:01AM
(#20564913)
For what it's worth, there are only two, maybe three methods in that entire list that mutate where it's not obvious: sort, reverse, and (maybe) splice. All the other methods (like push, pop, fill, etc) are methods whose entire purpose is to mutate the array.
[ Parent
| on HN ]
That was my first impression. But then the same logic applies to concat. ("I want to add another array").
Re:What’s New in ES2019
by erikpukinskis on Wednesday July 31, 2019 @01:30PM
(#20576398)
Sometimes I don’t. Actually usually I don’t, I do a lot of [].concat(a, b).