Dont repeat yourself


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


why is this code printing the price twice??


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


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!