While loops #5


Im not sure what Im doing wrong and the loop at the bottom (outside the local code) is really confusing me. please help

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

var loop = function(displayMsg){
	while(count < 3){
	console.log("I'm looping!");



You defined an argument but didn't use it.

It is either ++count or count++.


thanks a lot

Replace this line with your code.


Any idea why this is making the page crash?

//Remember to make your condition true outside the loop!
var myCondition = true;

var soloLoop = function(soloLoop = true){
while (soloLoop= true) {
console.log("Looped once!");
myCondition = false;




Assignment in function and loop.

Condition not being used.


I see what you mean with the double assignment, but how do I use the condition?


You must put it in the while condition. :slight_smile:


What variable should be put in function ?

var count===0;

var loop = function() {
while( count < 3) {
console.log("I'm looping!");



You are comparing rather than assigning.


thanks for your help ! never forget again :smiley:


This topic was automatically closed after 12 hours. New replies are no longer allowed.