Is there any way in javascript which can modify array value. I have done it by using for loop and there is another method call forEach. I wanted to get it done by using only one line. Like I have seen code for converting onject into array by using Array.prototype.slice. So can we get the requirement done by using similar function. I google it but did not find any relevant post.
this.gome = (function(data){
for(var i=0;i<data.length;i++){
data[i].id = i
}
return data })(data.gome);
this.gome = Array.prototype.slice.call(data.gome,//code) // something like that.
forEachexactly? Should be perfect here.