To learn it you gotta 'Do' it. NEED HELP


#1

javaScript lesson 7: to learn it you gotta 'do' it.

Am I doing something wrong? I dont get this!

var Runner = true
var getToDaChoppa = function(){
    do {
        console.log("Doing Doing Doing!");
        
    };while(runner === 1);{ 
        console.log("I'm looping!");
        Runner = false;
    };
};

getToDaChoppa();

#2

a do while loop:

do {
  // do something
} while (condition)

while loop:

while(condition){
  // do something
}

now, you can not combine a do while and a while loop into a do while while loop (what you did)

also, be careful where to place semi-colons


#3

Ok i will try that. I am confused on the whole semi-colen thing.


#4

just leave out the semi-colons for do while and while loop, not important, that will come later


#5

I'm still getting a problem! It wont work! Here is my syntax,

var runner = true
var getToDaChoppa = function(){
do {
console.log("Do/ while loops are really hard" + runner + "!");
}while(runnner = true);

};

getToDaChoppa();


#6

Nevermind! I got it to work I just misspelled something... lol whoops


#7

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