Im starting to study JavaScript and i dont understand how does the following code work as intended.The goal is to basically ask the user for a number until the number user inputs is greater than 100 or until user doesn't want to input anything and therefore cancels.This code apparently does exactly that:
let num;
do {
num = prompt("Enter a number greater than 100?", 0);
} while (num <= 100 && num);
What i dont understand it how it doesn't fail since if input in while is 0 then num equals false and loop terminates but for some reason 0 is fine in this example and user is repeatedly promoted each time and code works?