Spread operator(...
) for an object is not working as you can see in the below code. Is this expected behavior? try it in jsbin
//var test ={start:'stating',end: 'ending'}; //its not working
var test=['start-value','end-value']; //its working
function display(start,end){
console.log(start,end);
}
display(...test)
The reason behind asking this question is, I saw the use of spread operator using an object in the below line of code but it's not working for me.
Am I missing any configuration to make it work ?.
Aucun commentaire:
Enregistrer un commentaire