+ 1
Need clarification please.
var arr = []; for (i = 2; i > 0; i --) { arr [i] = i; } document.write(arr.length*i);
1 Réponse
+ 2
The answer will be 0.
Since you didn't define 'i' as 'let', it is global. Therefore, at the end of the loop, 'i' will be zero and arr = [null,1,2].