Dont repeat yourself DRY i dont understand 6/13 send help!


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

Replace this line with your code. 
var orangeCost = function(cost){ 
var price=5*cost;
console.log("total cost:"+" "+price+" "+"dollars");



This exercise does not ask you to print out a string in addition to the result.

You can remove the variable price and instead console.log(5*cost). It's finding "total cost: 5 dollars" instead of just "5" .

You're code is fine, it's just not what is asked for.


thank u it worked for me


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