Don't Update Function Argument Values
Do not change those non-primitive function arguments without understanding the significant implications of your action. Programming languages have pass by reference and pass by value to pass arguments to a function. Javascript passes values for primitives, but references when you are trying to pass objects. Changing arguments within a function will change the arguments for ever. function hello(addressee) { addressee.name = "Mr. Anderson"; return "Hello " + addressee.name; } const person = { name: "world" }; console.log(hello(person)); // Hello Mr. Anderson console.log("person: ", person); // person: { name: 'Mr. Anderson' } It is a disaster if the world is treated as Mr. Anderson. ...