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.
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...