I started using object spread syntax to safely make a copy of the object while following immutability principles.
I want to use it in chrome developer console - how to do this:
I started using object spread syntax to safely make a copy of the object while following immutability principles.
I want to use it in chrome developer console - how to do this:
You can enable the javascript experiments flag on: chrome://flags/#enable-javascript-harmony to enable web pages to use experimental JavaScript features including the Rest / Spread.
Object spread is available in all modern browsers (since Chrome 60) and can be used like this:
{...{foo: 'bar'}, john: 'doe'}
And will return: {foo: "bar", john: "doe"}
...
is not an operator (at least not in the sense the ECMAScript spec uses the term "operator"). It is actually called "spread syntax", or "rest syntax".