Don't repeat Yourself


#1

Hellpppp im stuck and i need to finish tons before I go back to school, also it would be great if some one knows how they can explain functions to me somehow !! but im stuck on this at the moment !!

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


var orangeCost = function (price) {
    var newPrice = price * 5;
    console.log("the Oranges cost" + " "+ newPrice)
};
orangeCost(5);

thanks :slight_smile:


#2

@aidenmolluso,
The course-checker expects you to use
console.log(newPrice);


#3

I am also confused mine keeps saying Oops, try again. Hmm, it looks like your orangeCost() function doesn't return 25 when the cost of an orange is 5. even when I made mine with the newPrice variable


#4

ok thank you!!! It helped me alot and it worked


#5

Sorry , doesn't work !


#6

Thanks . It did work !


#7

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