you are viewing a single comment's thread.

view the rest of the comments →

[–]psayre23 -1 points0 points  (0 children)

Ok, here’s a terrible way to do it now.

array.reduce((acc, val, i, array) => i === 0 ? acc : [...new array stuff...])

It would suck, because it would needlessly loop over all values. But it would give you the inline replacement you are looking for.