While syntax



It crashes the page when I click 'Save & Submit Code', thanks for any help x

var understand = true;

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


When you use only one = that is interpreted as an assignment character. To check if something is equal to something else use either == or ===. In this case if you want to check if understand is true you can just use while (understand) and java-script knows that you mean while (understand == true).


thank you, this worked xx


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