Why use three (...newArr) in the following. is This syntax?? | SoloLearn: Learn to code for FREE!

+1

Why use three (...newArr) in the following. is This syntax??

let newArr = ['Three', 'Four']; let = ['One', 'Two', ...newArr, 'Five']; console.log(arr);arr

6/17/2019 11:20:59 AM

Bashdar A.Muhammad

1 Answer

New Answer

+2

Its the spread syntax. refer to the mdn for full explanation. https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Spread_syntax