i = 0;
for( ;i<3; ){
alert(i++);
}
The above code should output a '1' after the first iteration as 'i' has been initialized as 0. Instead, the first alert brings up a '0'. How is this logically correct as the first output should've been the incremented value itself?alert(i++);
This is syntactically equal to the code
for (let i=0; i<3; i++)
{
alert(i);
}