Spread Operator in Javascript

 

Spread syntax (...)

Spread syntax can be used when all elements from an object or array need to be included in a list of some kind.

let arrayA = [1, 2, 4, 6];
let arrayB = [3, 5, 6, 8, 9];

let arrayC=[...arrayA,...arrayB]
console.log(arrayC);

 

About Author

Photo

Hi, I am Mahbub Hasan
Software Engineer

I am very much interested to share my programming
and development knowledge with the people.I will try
to update my blog everyday with new technology inshallah.

Thank You

For Visiting My Blog.

Contact Me