Quiz help need at ice cream order, function

function order(number, flavor){

  if (number<2){

console.log(`Lemme get ${number} scoop of ${flavor}!`);

} else{

console.log(`Lemme get ${number} scoops of ${flavor}!`);




order(3, 'chocolate'); 

The problem is undefind, i don’t know where is the problem, help me please.


I don’t see any error in this code (although you may need to repaste pressing the </> button Screen Shot 2020-10-30 at 10.12.54 AM first. I suspect if you are getting undefined it might have something to do with what kind of quote marks you’re using.

When I run your code on my machine it works perfectly:

I changed the console.log to return and changed “else” to “else if” and it passed. There is nothing wrong with your code. I think the quiz is looking for the return keyword in the code block. IDK, maybe?

Drop the “;” at the second to last “}” and put a space at the “if (number<2){” so that it looks like this: “if (number < 2){”