Hello help on 6. Don't Repeat Yourself (D.R.Y)


#1

var orangecost = function (price *5)
};
(orangecost("2"));
};

i get SyntaxError: Unexpected token *

please help im new.


#2

A.) Your function name isn't correct.
B.) You can't run evaluations in the function input.
C.) You used an ending brace for the start.
D.) This line does nothing. (orangecost("2"));

I would suggest reviewing all lessons you've taken so far.


#3

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


#4

Thank you too much!!!


#5

2 posts were split to a new topic: 6. (D.R.Y.) it looks like your orangeCost() function doesn't return 25 when the cost of an orange is 5