spread operator parameters code example
Example 1: spread operator javascript
obj = {first_name : "Marty",
lovers: ["Jennifer Parker","Baines McFly"]
};
let objClone = { ...obj };
console.log(objClone)
Example 2: spread operator javascript
const parts = ['shoulders', 'knees'];
const lyrics = ['head', ...parts, 'and', 'toes'];
Example 3: spread and rest operator javascript
var myName = ["Marina" , "Magdy" , "Shafiq"] ;const [firstName , ...familyName] = myName ;console.log(firstName);
Example 4: spread operator es6
[...fruits]