I have this code;
function pedirContra(){
while(contra!="felix123"){
alert("A");
}
}
As you can see, nothing is happening because I have not defined contra. However, if I do so define it using var contra inside the while loop, it will work. Why? Is JavaScript reading the while always, even if the condition doesnt apply? Python always says that the variable doesnt exist.
I tried understanding the code, the only answer I got from myself and my small knowledge, is that JavaScript always reads things even if the conditions dont apply.