What did i do wrong?


#1

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

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

loop();


#2

your expression for console.log is incorrect, look that up and re-write it. Make sure to put a semicolon to terminate statements and assignments


#3

The part of about the console.log is correct it needs to be console.log("I'm looping") and it is correct that one should end a line with an assignment or statement with a semicolon but what do they have to do with regular expressions?


#4

I corrected it, I should have wrote statements instead of expressions :smile:.


#5

Ok just confused because there are regular expressions in javaScript. Which are pretty cool by the way but which look kind of different.


#6

I don't know by me it's still not working.


#7

What have you changed could you post the updated code?


#8

this is the new script still not working

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

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

loop();


#9

Ok that seems to be fine. Maybe refresh the page and try again. What is the error message?


#10

this s the error message
Oops, try again. It looks like you're not printing the right string to the console


#11

Well then have a look a the requested string. Maybe add an "!" at the end if there is one in the instruction.


#12

thanks now i's working! the problem was it was missing a "!":smiley::grin: