Functions that contain multipliers


#1

I'm getting a weird result, and I'm not sure what I'm doing wrong. I want to create a function that multiples (number * 5). When I just put in (number) I get a single correct result. But when I sub in (number * 5) I get two results. The first one is correct and the second one is always 25. Is that some weird glitch (because the lesson's answer is 25), or is something wrong with the way I'm writing the code?

FIRST TRY: Returns one result, but doesn't include the multiplier.
var orangeCost = function (number) {

console.log("Five oranges cost $" + (number) + " today.");

}

orangeCost(1.5);

RETURNS: Five oranges cost $1.5 today.

SECOND TRY: Returns 2 results, but one of them is wrong.
var orangeCost = function (number) {

console.log("Five oranges cost $" + (number * 5) + " today.");

}

orangeCost(1.5);

RETURNS:
Five oranges cost $7.5 today.
Five oranges cost $25 today.


#2

I think it is a glitch but you did wrong too :slight_smile:

You should only console.log the sum nothing else.