D.r.y


#1


var orangeCost = function(price){
    console.log("orange cost is" + "     " + 5*price)};
    orangeCost(5)

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

I get the correct answer 25, but it appears twice. The resonse from codeacademy is Oops, try again. Hmm, it looks like your orangeCost() function doesn't return 25 when the cost of an orange is 5.


#2

Please include a link to the lesson, your code, and any errors you're getting.


#3

@javascript_student

Replace console.log with a return you only need it once so you use return like this

It should be fixed, I was struggling on this for a bit too.


The code don't runs, please help
#4

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