Step 6, D.R.Y. Hallo again, what could be the problem with this code


#1


https://www.codecademy.com/en/courses/javascript-beginner-en-6LzGd/1/1?curriculum_id=506324b3a7dffd00020bf661#


Oops, try again.
There was a problem with your syntax.


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


#2

Still not working am stuck

orangeCost = function(price) {
var price = orange*5;
console.log(price);
};
orangeCost("price"*5);
Please assist.


#3

var price = orange*5; // orange is not defined
and
orangeCost("price"*5); // wrong

and you dont need var price

orangeCost = function(price) {
return  price*5;
console.log(price); //you can remove this
};
orangeCost(5); //calling the function

#4

this worked too...

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

orangeCost(5);


#5

Try this :

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


#6

Good morning. Thanks much it worked.


#7

Thanks much boarjumper for your assistance.


#8

I appreciate your help. Have a good day


#9

Which country are are you in, Germany?


#10

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

It says orangeCost is not defined but it returns that correct answer


#11

Check the instructions for what they want the name of the function to be.


#12

Thanks much for your reply. Good day


#13

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