11.Review\*what went wrong*\


var i=1;
var forLoop=function();

for (var i=1; i < 11; i++)
var whileLoop =function();
var whileLoop = true;
while (whileLoop<5)

var doLoop=function();{
{console.log("I win");}



where to start? If you have a function, the start and end of a function are marked by a curly bracket:

var forLoop=function(){
  // function content

important: the semi-colon is after the closing curly bracket of the function

the condition of your while loop:

while (whileLoop<5)

is slightly worrying, while function is less then 5? I think you should use a different variable then whileLoop.

your do while loop looks like a infinity loop. i is one, so the condition is always true, the loops keep running for ever


my "whileloop" string is not being printed?
where do e'm wrong

var i=0

var forloop=function()
  console.log("ping ping");
    for ( i=1; i < 11; i++)
console.log('trang trang");
console.log("bluff bluff");};
var whileloop=function(){
    console.log("blah blah: " +" +i);
    var i=0;


console.log('trang trang"); <- a apostrophe doesn't match with a quotation marks

this line:

console.log("blah blah: " +" +i);

the joining of the string and variable is bad. I am sure there are more issues, but without so many issues in your code, i can't keep debugging for you


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