+ 3

Could someone explain me how this code works line to line? Thanks.

var arr=[2,5,2,4]; var x=1; for(var i=0;i<arr.length;i++){ if(arr[i]%2===0) x*arr[i]; } alert(x);

3rd May 2018, 12:58 PM
Rastislav Romanec
Rastislav Romanec - avatar
3 Respostas
+ 3
How to get to the output x=16 in this code?
3rd May 2018, 1:10 PM
Rastislav Romanec
Rastislav Romanec - avatar