Stuck on to learn it you gotta do it


#1

Hello, i am not really understanding this new lesson of java so some help would be awesome! I know my code is incorrect so some tips to what i am doing incorrectly would be great and another explaintion of how the code works would also be amazin. Thanks :slight_smile:

var getToDaChoppa = function(){
  do { console.log("we must get to do chopper")
 }  while(getToDaChoppa = true);
};

getToDaChoppa();


#2

here:

while(getToDaChoppa = true);

why would you assign a new value to your function?

you should declare a variable to keep track of your loop condition, don't use the function for this

a single equal sign means assign, be very careful with that in loop conditions, are you sure you didn't intent to compare? Which requires 2 or 3 equal signs


#3

Thank you so much haha stupid mistake on my part!!!


#4

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