Introduction to functions in JS orangeCost


#1

Having trouble with this. Here is my code with the error

var orangeCost = function (price){
    console.log("The cost of oranges today is" + " " + price * 5) }
    orangeCost(5)

"Oops, try again. Make sure your function takes a parameter that is the cost of an orange, and multiply it by 5."


#2

The code checker in this exercise doesn't want to see any extra chitter chatter, it just wants to see 25.

Too bad, because it is nice to give meaningful responses to your users.


#3

Alright, thanks! It never mentions that in the exercise.


#4

Yeah, that is too bad.

I got "around" it by doing this:

console.log ("The cost of the oranges will be");
orangeCost(5);
console.log ("this week.");

Not pretty, but it was the principle of the matter. ha ha