Var count = 0 vs. var count === 0; Why doesn't the latter work?


SyntaxError: Unexpected token ===

var count === 0;
var loop = function()
		//Your code goes here!
		console.log("I'm looping!");
		count ++;


Why does var count = 0 work but var count === 0 doesn't work?


because a single equal signs assigns a value of 0 to to count (it creates the variable, or update the variable, depending on how you use it), two or three equal signs is used for comparing 0 with count

This should have been covered a long time ago, revisit some exercises if you don't remember.


Yeah, was covered way back in one of the first exercises. Thanks!