I need some help


#1

Hi
When I enter the code below, the editor tells me that it is okay but nothing got printed.
Can someone tell me where I went wrong.
var getToDaChoppa = function(i){
do {
console.log("Ashraf")
}

while (getToDaChoppa() <= 0);
};


#2

You just declared the function, you don't call it, so it won't get executed.

var getToDaChoppa = function(i){
  do {
    console.log("Ashraf")
  } while (getToDaChoppa() <= 0);
};
// call function
getToDaChoppa()

#3

Also this is a really weird condition. Could you explain what you think it does? Maybe we can help you so that it will actually do what you expect it to do. Because currently this calls the function inside itself and then you compare the returned value to 0 but this function does not return any value and calling it inside itself will only lead to some sort of function infinite loop (recursion).