Because you said i>0 me ans until i is greater than zero. you can use i>=0 then it will be correct.
Let me explain in deep:
result = [];
for (i = 4; i > 0; i -= 2){
result.push(i);
}
I = 4, I is greater than zero so i-2
I = 2, I is greater than zero so
I-2
I = 0, but 0 is not bigger than 0 so loop will end

Because you write:
i > 0
But this will not print 0 because (i) is greater than 0
For solving this problem just add:
i >= 0
Now (i) is equal or greater than 0 and it will print 0 too.

I working like this
I=4>0;
Print 4 //in result
now I= 2
I=2>0
Print 2 //in result
Now I=0
I=0 not >0
Hence no print.//in result
hope I clear my view to u.

Divya Mohan but, when
i = 2, 2 > 0, so i = 2-2
so i becomes 0
then
i = 0, 0>0 (false) so it wont go for 3rd condition.
but i value still remains 0 right ?