D.r.y


#1

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

};

orangeCost("5");


D.r.y
#2

You have a few errors. On line 2 of your above code, $ is not needed. On line 3, you have "val" which is a string. You need to use the variable val (no quotes).

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

#3

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.