DEV Community

Discussion on: 5 Way to Append Item to Array in JavaScript

Collapse
 
johnkazer profile image
John Kazer

The point about not mutating if you need the array elsewhere is a good one, especially for parallel or concurrent programming. Even in single threaded JavaScript you might have passed an array by reference and so mutate things unexpectedly. Generally I find non-mutation to be a more relaxing method!

Collapse
 
samanthaming profile image
Samantha Ming

Yes, great point John! Let me add that to my notes! Thanks for sharing πŸ‘