I'm surprised that the following code works:
while(fred !== "stop"){
var fred = prompt("Should I stop or go?")
};
I'd understand this in a do while loop:
do {
code to be executed at least once
}
while (condition);
How is JavaScript able to set up the condition before the function has declared fred to be a variable?
Other questions I've read pertain to var declarations inside the conditional.