Function is called twice


#1

this is my script

var orangeCost = function (price)
{
var result = 5 * price ;
console.log ("Cost of Orange for this week is" + " " + result);
};
orangeCost(10);

and this error fired on me
"Oops, try again. Hmm, it looks like your orangeCost() function doesn't return 25 when the cost of an orange is 5. "


#2

Simple mathematics, unfortunately. When you input the parameters for the function, you put "10". 10 * 5 is 50. That's why you're getting the error message that it isn't returning "25". Try changing the parameter to 5:
orangeCost(5)


#3

var orangeCost = function (price)
{
var result = 5 * price ;
console.log ("Cost of Orange for this week is" + " " + result);
};
orangeCost(5);

Still same error :-
Oops, try again. Hmm, it looks like your orangeCost() function doesn't return 25 when the cost of an orange is 5.

And output says something like
Cost of Orange for this week is 25
Cost of Orange for this week is 25


#4

I'll be honest, not 100% sure why it's posting twice, but here's my code that returns properly:
var orangeCost = function (price)
{
console.log(price * 5);
};
orangeCost(5);


#5

i think error lies in the console of my code anyway thanks i will try to write something similar to yours