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"}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With