Name thy variables while destructuring arguments
Destructuring is useful but what if you have conflicts with the variable names provided by the object being imported? Consider the following example where we destructure arguments of a function. const getSum = nums => { let { x, y } = { ...nums }; return x + y; }; console.log(getSum({ x: 1, y: 9 })); //10 We can get into a pickle if the function already has a variable x. Well, not exactly in the above example but in a real world program that tends to have a hundred lines of code, and interact with a thousand other components. ...