hi,
will like to ask what is wrong with my code. It doesn’t work on codecademy quiz.
The question
Define an order()
function that announces your ice cream order.
It should take two arguments: the number of scoops and the flavor. It should return the order in this format: "Lemme get [number] scoops of [flavor]!"
It should use “scoop” when number
is 1
and “scoops” for anything greater.
For example:
// Returns "Lemme get 1 scoop of vanilla!"order(1, 'vanilla');// Returns "Lemme get 3 scoops of chocolate!"order(3, 'chocolate');
My answer
function order (number, ‘flavor’) {
if (number === 1){
return “Lemme get " + number + “scoop of " + flavor”!”
}else (number > 1) {
return "Lemme get " + number + "scoops of " + flavour"!"
}
}
order(2, ‘vanilla’)
Thank you in advance!