Rasi
answered Nov 30 '-1 00:00
it make array to flat value in sequence .
if you know list function in php . spread operaton work same
suppose in php
list(x,y)=array(4,5);//x=4 , y=5
in JavaScript
fuction PrintArray(x,y){
console.log('a[0]= '+x+',a[1]='+y);
}
var a=[1,2];
PrintArray(...a);//a[0]= 1,a[1]=2
it send array all index to function argument. isnt it magic in JavaScript ?