I'm completely new to coding and have started learning JavaScript recently. I don't understand why the following code causes an infinite loop. Why does the birthday(myAge)
function not work within the loop to make the condition (myAge < 23)
false?
var myAge = 22
var birthday = function(myAge){
return(myAge + 1);
}
while (myAge < 23){
console.log("You're only 22");
birthday(myAge)
}