Need Help: Lesson 6 'Don't Repeat Yourself (D.R.Y)': orangeCost * 5


#1

What is wrong with this code?

Code:
var orangeCost = function (cost) {
console.log("The cost today is "+ cost*5);
};
orangeCost(5);

Results:
The cost today is 25

Error:
Oops, try again. Hmm, it looks like your orangeCost() function doesn't return 25 when the cost of an orange is 5.


#2

try calling the function inside a console.log() statement.


#3

I am still confused. What is the desired outcome, a number "25" or a sentence "The cost today is 25" or something else?


#4

Got it.

Thank you!!!


#5

please delete the answer because we do not want give people the answer just like this.


#6

I am not sure what is wrong with my code. It seems to work and yet it says that I didn't define orangecost.
What seems to be the problem?

Nevermind!!


#7

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