Answers for "spread operator and rest operator in javascript"

3

spread and rest javascript

var myName = ["Marina" , "Magdy" , "Shafiq"];var newArr = [...myName ,"FrontEnd" , 24];console.log(newArr) ; // ["Marina" , "Magdy" , "Shafiq" , "FrontEnd" , 24 ] ;
Posted by: Guest on May-02-2020
3

spread and rest javascript

var myName = ["Marina" , "Magdy" , "Shafiq"] ;const [firstName , ...familyName] = myName ;console.log(firstName); // Marina ;console.log(familyName); // [ "Magdy" , "Shafiq"] ;
Posted by: Guest on May-02-2020
7

the rest operator javascript

function sum(...numbers) {
	return numbers.reduce((accumulator, current) => {
		return accumulator += current;
	});
};
 
sum(1,2) // 3
sum(1,2,3,4,5) // 15
Posted by: Guest on January-14-2020
2

spread operator javascript

obj = {first_name : "Marty",
    lovers: ["Jennifer Parker","Baines McFly"]
      };
let objClone = { ...obj }; // pass all key:value pairs from an object 

console.log(objClone)
// { first_name: "Marty", lovers: ["Jennifer Parker", "Baines McFly"] }
Posted by: Guest on December-16-2020
0

spread operator javascript

[a, b, ...objIteravel] = [1, 2, 3, 4, 5];
Posted by: Guest on October-27-2020
-2

spread and rest operator javascript

function myData(...args){console.log(args) ; // ["Marina",24,"Front-End Developer"]}myData("Marina",24,"Front-End Developer") ;
Posted by: Guest on June-25-2020

Code answers related to "spread operator and rest operator in javascript"

Code answers related to "Javascript"

Browse Popular Code Answers by Language