DEV Community

Discussion on: What Javascript Spread Operator is, How It Works and How to Use It

 
pentacular profile image
pentacular

What's the distinction that it makes?

JS doesn't allow you to mutate values at all -- and there's no difference between objects and values in that regard.

The only things you can mutate in JS are properties and variables.

(And this is one of the reasons that properties are not part of the object's value)

Thread Thread
 
fernandomk6 profile image
Fernando Henrique

Objects and primitives have their values copied when the assignment sign is used. Primitive values are literal values, object values are pointers.