While loop


#1


https://www.codecademy.com/en/courses/javascript-beginner-en-ASGIv/2/3?curriculum_id=506324b3a7dffd00020bf661#


Oops, try again. It looks like your loop syntax isn't quite right--check the Hint if you need help.
also ,
ReferenceError: getToDaChoppa is not defined


var getToDaChoppa = function(){
var getToDaChoppa = false;
  // Write your do/while loop here!
  do {
      console.log("I'm going to the chopper once because I'm " + getToDaChoppa);
  } while(getTodaChoppa);{}
};

getToDaChoppa();


#2

Firstly you only need to declare getToDaChoppa as a variable once. But mainly your code is invalid due to quite a few reasons.

Your finished code needs to look something like this.

var x = 0;
var getToDaChoppa = function(){
  do{
  console.log("Get to tha choppa!");
  x++;
  } while (x < 1); 
};
getToDaChoppa()

Please study this code and if you have any question please feel free to ask.


#3

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