Is there anything wrong because it says that didn't define orangeCost


var orangeCost = function (price){console.log("what is the price")};
orangeCost = 5; console.log(orangeCost*5)


var orangeCost=function(price)

orangeCost is function you defined and you just could to recall it, for example orangeCost(5).
In that function you want to know how much cost 5 oranges and that is why console.log(price*5), so your function print price of 5 oranges. I you have questions, just ask.

P.S. Instead of console.log you can use return, you will get the same result.


Good morning everyone. I am having the same problem here: it keeps telling me "you didn't define orangecost".
This is my code so far:
var orangecost=function(price)

Could anyone tell me about it...what is wrong?...
Thanks in advance


I think you should write "orangeCost" instead of "orangecost". Good luck.


I'm having the same problem. Here is my code:

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


It's saying that I didn't define orangeCost. Some people on this forum have corrected others with this code, which happens to be mine, but it's still not working. I know some people have mentioned creating another variable within the function as var val = price * 5 instead, but should this be necessary?


Ohhh.... haha, yeah the O in OrangeCost was capitalized. Silly me. Be careful with your debugging kids.


you put number in the function() not price. it should look like.
var orangeCost = function(number) {
return(number * 5)