DEV Community

Discussion on: To Mutate, Or Not To Mutate? JavaScript Array Methods Cheat Sheet

Collapse
 
liaowow profile image
Annie Liao

Thanks for reading, Ru! Given the mutable nature of JavaScript objects, I haven't found a similar pattern when it comes to built-in methods. Even a commonly-used method Object.assign() only creates a shallow copy of an object -- technically it does mutate, even though on the surface, it doesn't seem so.

Here's an article that explains further. Hope it helps! alistapart.com/article/why-mutatio...