How to get the statement to log


#1



Unexpected token '++'


//Remember to set your condition outside the loop!
var count = 0; 

var loop = function(count++){
	while(count < 3);{
	console.log(count);	//Your code goes here!
	}
};

loop(count);


#2

a function takes only value, not expression

count is a value
count++ is expression

remove the ++ and you good to go, for the function that is.

For the while loop, make sure it goes to an end.
Your code saying that count will never change (keeps on "0"), the condition is "less than 3", which lead to never ending story (logging "0" forever).
Inside the loop, after printing out, put "count++"


#3

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