Why dosnt this work


#1

var soloLoop = function(){
while(loop) {
console.log("Looped once!");
loop = false;
}
};
soloLoop();


#2

You first have to set loop to true.
var loop = true;
var soloLoop = function(){
while(loop) {
console.log("Looped once!");
loop = false;
}
};
soloLoop();