When I want to loop
through an array
and add a string behind every element
,
I can either
for(var x in array){
array[x] += "string";
}
or
for(var x, y = array.length; x<y; x++){
array[x] += "string";
}
But is there any difference in terms of performance between these 2 for loops
?