If you need a copy of an object that doesn't change when the original object is mutated, there are a 3 ways to do that. In this tutorial we look at the best ways to clone a JavaScript object.
JavaScript ES6 (ECMAScript 6) introduced the spread operator. The syntax is three dots(...) followed by the array (or iterable*). It expands the array into individual elements. So, it can be used to expand the array in a places where zero or more elements are expected.
#JavaScript #ECMAScript #Spread Operator