459 B
459 B
let num;
do {
num = prompt("Enter a number greater than 100?", 0);
} while (num <= 100 && num);
The loop do..while
repeats while both checks are truthy:
- The check for
num <= 100
-- that is, the entered value is still not greater than100
. - The check for a truthiness of
num
checks thatnum != null
andnum != ""
simultaneously.
P.S. By the way, if num
is null
then num <= 100
would return false
, not true
!