Dont repeat yourself


#1

var orangeCost = function(cost)
{ var price=5*cost;
console.log("total cost:"+price+"dollars");
};

orangeCost(5);

why is this code printing the price twice??


#2

the exercise most likely also calls the function, which is results in a double output, nothing to worry about


#3

For some reason putting any text in the console.log command causes a double print (and the multiplier to be off, try 6 instead of 5). Just put in cost (or price in your case, console.log(price); ) and it will print the price just one time. Must be they hard coded 5 as the multiplier and have a bug somewhere haha!