Please help with the code


What is the error in this code. It is printing out two times
And also giving error.

var orangeCost = function (price) {
var TotalCost= price*5;
console.log("Total " +TotalCost);


what's the error message?


Oops, try again. Hmm, it looks like your orangeCost() function doesn't return 25 when the cost of an orange is 5.


it's because your function doesn't return anything.use return instead of console.log


return ("Total" +TotalCost);

Its printing out the quates too


can you please post the lesson link so i can check

don't use any string value just return the value


Its a DRY lesson


return TotalCost;


but I want output as " The total cost is 50"


sorry,in your own environment you can do whatever you want but here you must follow the instruction.

so your code was fine but here it'll not accept.


Here this works

The way i got through this one


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