Why use three (...newArr) in the following. is This syntax?? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 2

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

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

17th Jun 2019, 11:20 AM
Bashdar Abdalrahman MOHAMMED
Bashdar Abdalrahman MOHAMMED - avatar
1 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
6th Jul 2019, 6:21 AM
Travis
Travis - avatar