Do/ while loops


#1


This whole function button is messing with me. as is, the code is crashing the page. what am I doing wrong?


var getToDaChoppa = function(){
 do {
     console.log("heck yeah")
 }
 while(getToDaChoppa)
};

getToDaChoppa();


#2

Sounds like an infinite loop. What do you expect the function name to do in this condition?

while(getToDaChoppa)


#3

Outside of your loop, set a variable as false. Then change while(getToDaChoppa) to while(variable you set as false)

For Example:
var arnold=false
var getToDaChoppa = function(){
do {
console.log("heck yeah")
} while(arnold)
};

getToDaChoppa();