6 D.R.Y Help please


I've looked at some of the other posts but they're all a little different.

My code:

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

Console log shows:
The cost of 5 oranges today is 25 dollars
The cost of 5 oranges today is 25 dollars

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


your code is correct and works. Unfortunately it can not be validated as such by codecademy because it is waiting for a precise sentence to be printed. You should print only the total price without any other word



The companion to D.R.Y. is do not add what is not asked for. This exercise is explicit about what is expected. A number. That is all. Don't log anything else but a number.


Thank you both! Apparently I like to interpret instructions my own way...


It is true or false

var orangeCost = function (number)
var val = number * 5 ;
console.log (val +"$");