Thanks for noting!
Hmmm, now you are mutating fruit array.
Are you sure you were not trying to do something like
const fruitsAndVegetables = fruits.concat(vegetables);
const fruitsAndVegetables = fruits.slice();
I don't believe there is a neat little 1 liner to do the equivalent without wrapping 'carrot' in a temp array.
I feel the same way...the new syntax is much more compact.
We're a place where coders share, stay up-to-date and grow their careers.
We strive for transparency and don't collect excess data.