Error in D.R.Y, Introduction to Functions in JS


#1


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


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

I get the error message above, but the console does print "The cost is 25".

"What seems to be the problem, officer?" :slight_smile:


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

orangeCost(5);


#2

HI just remove the string keep just this part

console.log(price * 5);

#3

Oh, lol. Thanks, man. That did the trick :slight_smile:


#4

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