Introduction to While, cant go further, SOS


#1


 I DONT UNDERSTAND WHAT TO PUT IN THE CONDITION
var understand = true;

while( understand === 1 ){
	console.log("I'm learning while loops!");
	understand = false;
}


#2

you declare understand as true, so maybe you should check if understand equals true?


#3

while( understand === 1 )

Your while loop condition is not working because you are using "===" which is known as the strict equality operator. if you want your code to run, use the "==" double equality operator.OR simply change 1 to true.

Break Down.
in javascript, the number 1 is equals to "true", and 0 is equals to "false"
but technically, The number 1 and 0 are integers while true and false are Boolean

When you use the double equals operator, this technicality is avoided, but when you use a
triple equals operator, you are strictly asking the computer to make sure that the data types are strictly the same and not an alternative.


#4

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.