Check this code please :) I'm stuck at (D.R.Y) functions #6


#1

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

var buyOranges = function "orangeCost"(price)
{
  ((price) * 5);
}
buyOranges(1)

#2

The instructions ask for a function named oranageCost.

var orangeCost = function (price) {
    console.log(price * 5);
};
orangeCost(5);

#3

Hello, Can you please let me know why am i getting the output printed twice? And even when I change my price value (input parameter), the second statement printed still shows $25 (for $5 price) under the first statement which actually gives the right result for total cost of 5 oranges for the given price as input.

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

orangeCost(5);

#4

I did it like this and it worked out very well :var orangeCost =

function(price = 5)
{
console.log(orangeCost * 5)
};


#5

It may be printing twice because the SCT is running the program to test its output. If I recall correctly, there should be no additional text in the output, just the number 25.

This is not how the program is meant to look. It should not have passed.