Return 1 exercise error


The console says i’ve done the exercise right, but that exercise is supposed to return a number (3) multiplied by a price (7.5), but it returns a 0.
What’s the problem in the code? and why does the console consider the exercise good?


let orderCount=0

const takeOrder=(orderCount= orderCount + 1, topping, crustType)=>{
console.log('Order: '+ crustType + ’ pizza topped with ’ + topping)

const getSubTotal=(itemCount)=>{
return (itemCount*7.5)

takeOrder(‘bacon’, ‘thin crust’)
takeOrder(‘potatoes’, ‘thick crust’)
takeOrder(‘mushrooms’, ‘thin crust’)

<do not remove the three backticks above>


orderCount= orderCount + 1 should be part of part of the takeOrder function content, not the parameter

the exercise approves because earlier written code isn’t re-evaluated


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