The concept of mutability and immutability in JavaScript is essential to understand to avoid errors. Whether a data type is mutable or not is strictly tied to whether its a primitive or a reference type.
Details Here:
https://cloudaffle.com/post/mutability-vs-immutability-javascript