Stuck on D.R.Y


#1

Hi all, I am stuck on this exercise. Would really appreciate any help. Thank you!

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



#2

... function doesn't return 25...

Your function is logging the amount, along with some embellished text, neither of which are asked for in the instructions.

var orangeCost = function (price) {
    return price * 5;
};

The above is all we are asked for. Nothing more. Notice that we return a value, and do no logging in this exercise? Many exercises are like this so do your utmost to follow the instructions as closely as possible. It will make the course easier to get through.

Of course, once we pass a lesson, we are free to tinker with it and experiment. We will not lose the checkmark we earned.


#3

Thank you for your help!!


#4

In that Lesson, Just remove "total cost=" in console.log("total cost=" + price);

i.e

console.log ( price );

It will work fine. The Answer/Output they need is 25.. not "total cost=25"


#5

Thank you for your help.


#6

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