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


var orangeCost = function(price){
    console.log("Cost to buy an orange today is " + price);
      cost = price*5
    console.log("Cost to buy 5 oranges is " + cost);



where did i go wrong?


You can make it more advance just by adding one more parameter in your function like this.

var oranges = function(price, num_oranges){
   Cost = console.log("cost of one orange" + price);
   Many_oranges = console.log("cost of " + num_oranges + " is " + price * num_oranges);


Sorry about the format I can't do it on phone.


It seems to be over the top for the exercise which just expects an output of 25 for an input of 5. So although the explaining strings are a good idea to pass this one just console.log the calculate cost variable.


i did.
The same error is there.
Oops, try again. Hmm, it looks like your orangeCost() function doesn’t return 25 when the cost of an orange is 5


Without your code it's almost impossible to say what the error is only that your output is most likely not 25.


You are getting error because of you extra text inside the console.log try to just console.log(cost);


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

Should do the trick. Keep it simple


I've had that same error, my solution was made through:

function orangeCost(price) {
var tc = price * amount;
var amount = 5;


var orangeCost = function(price)
cost = price * 5




Thank You so much. Making life easier with man. Love You!!!!!!!


it is right when it return 25....only 25


Simply the best:

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



esto esta muy mal solo ay que poner la variable orangeCost=function(price) {
console.log("cost of one orange" * price);
y ya esta solo es eso mas nada


I had a similar problem. And the solution is to just print out the result without any text before it. In other words the console.log(); method just needs a variable inside and no text in quotes ("")