What does the 'Inside the takeOrder function' mean?


#1

Hello,

I’ve just started learning how to code a few days ago, and it had been going very well smoothly! (And it’s so fun) Thanks so much for the amazing contents. And it would be really great if I can get some help, as now I’m stuck trying to understand the following sentence:

Inside the takeOrder function, set orderCount equal to orderCount plus 1, so that each time the takeOrder function runs, 1 is added to the orderCount.

And this is what I’ve done so far:


var customerOrder = true;

function takeOrder (topping, crustType) {
if (customerOrder) {
console.log(‘Order:’+ crustType + 'pizza topped with '+topping);
customerOrder = true;
} else {console.log(‘nothing’);
customerOrder = false;
}

}
takeOrder(‘bacon’,'Thin crust ');
takeOrder(‘mushrooms’,'Normal ');
takeOrder(‘seafood’,'Low-Fat ');

var orderCount = 0;
function getRemainder (orderCount,thePrice) {
return orderCount * thePrice;
}
console.log(getRemainder(3,7.5));

I think “orderCount = orderCount + 1;” should be inserted somewhere, but I don’t know where and how it should be. Especially the sentence “Inside the takeOrder function” is confusing for me.

Thank you so much.

Warmest wishes,
Yeonhee


#2
function foo(param) {
    // inside the foo function
}

#3

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