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


#1


https://www.codecademy.com/courses/javascript-beginner-en-6LzGd/1/1?curriculum_id=506324b3a7dffd00020bf661#


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");
};

orangeCost(5);


#2

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.


#3

thank u it worked for me


#4

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