Getting Started
Diving into React
React Router and Forms
Redux
Server-side Communication
Project, Authentication and Deployment
Bonus Lectures

05. Spread and Rest Operator

Topic
Materials

// Spread Operator
let numbers= [1 ,2 ,5, 7]
let numbers2 = [7, 8, 9]
let arr = [ ...numbers, ...numbers2, 6, 7, 10];

let person = {
  name : "x",
  age : 45
}
console.log(arr);

let another = { ...person, nationality: "Bangladeshi"} 
console.log(another);


// Rest Operator
let something = (...numArr) => console.log(numArr);

something(1, 3, 5, 8);
Do NOT follow this link or you will be banned from the site!
×

Cart