Nugget 1: Use the Spread Operator to add a new property to an object
When using the spread operator to clone an object in Javascript, primitive properties (numbers, boolean, string) are copied. However, objects are not copied and what the clone gets is a shallow copy. Beware.
Comments
Post a Comment