10/11 need help


#1

This is my code:

var getToDaChoppa = function(){
// Write your do/while loop here!
do {
console.log("GET TO THE CHOPPER!!");
} while (getToDaChoppa);
};

var getToDaChoppa = false;
getToDaChoppa();

The error is saying that there is something wrong with the loop syntax, I don't see any though.


#2

You are declaring getToDaChoppa twice, the first time as a function and then reassigning it to a false, so getToDaChoppa() does not work because it's not a function anymore


#3

Thanks for the help!


#4

:thumbsup: You're welcome


#5

How do you actually change it so it can work?


#6

var getToDaChoppa = function () {
  i = 3;
  // execute the following at least once
  do {
    console.log('GET TO DA CHAPPA');
    i -= 1;
  } while (i > 0); // until the "while" condition is falsy
};

getToDaChoppa();