Stuck on Don't Repeat Yourself (D.R.Y)


#1



Whats wrong with this


console.log("5 oranges cost " + + price);
};

orangeCost(5 * 5)


Replace this line with your code.


#2

HI it's missing the orangeCost function


#3

It's not, it got cut out when I copied and paste


#4

Ok, so this line

console.log("5 oranges cost " + + price);

The lesson want you to only print the price so if i'ts 30 it should only print 30 so if you add a string it will se it like a error so in the console.log() you should do 5 * price
then in the call function

orangeCost(5 * 5)

just put the price


#5

what should i change

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

orangeCost(5 * 5)


#6

can you just type up what it should look like?


#7

this line

console.log("5 oranges cost" + 5* + price);

you should do the math like that

console.log(5 * price);

then in the call function

orangeCost(5 * 5)

you should only put the price which is 5


#8

ill try it! I hope it works!


#9

thanks so much! i was so stuck


#10

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