0
I didn't understand this code the result is 0 but I didn't understand the algorithm
var arr =[]; var x= 80 % 70; var y= 0; for (i=0;i<x;i++); if(i%3===0) y=arr.push(i); console.log(y)
6 odpowiedzi
0
% sign mean mode
X will be 10 value
After for loop; that means loop work for empty statement.
If (10%3===0)
This condition become false
So Y remain zero.
0
And what does it mean push and arr
0
This line will not execute.
this line means add y value to array
0
And the array it 0 so y equal 0 also
0
Console.log Display y value.
Var y=0
Set y mean 0
0
Thank you