To learn it, you gotta 'do' it: why does this work?


#1



Hi my code passes and seems to be correct. I'm just not sure why. Could anyone explain why and how this works? From what i can understand its saying console.log GET TO DA CHOPPA while it is false. But what is false to make this work and what stops it from running?


var getToDaChoppa = function(){
  do{ 
      console.log("GET TO DA CHOPPA");
      
      
     }
      while(0);
      
      
      
  
};

getToDaChoppa();


#2

@jason2921

First

You create a function called getToDaChoppa with no parameters.

Second

It logs to the console GET TO DA CHOPPA once.

Third

It stops doing it because of the 0.


#3

Cool, that makes sense thank you.