Please Help!


#1

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

it says i have a, SyntaxError: Unexpected token

var foodDemand=function(food);
{
    console.log("I want to eat"+" "+food);
}
foodDemand("apple");


#2

Try removing the semicolon on the first line.


#3

Why do you ask a function of the same name, and each other?

That's right, where the bold:

var foodDemand = function(apple) {
console.log("I want to eat" + " " + apple);
}
foodDemand("apple");

Although just checked and your version of the code is made! Hm strange

I realized what was going on - remove the semicolon after the first line


#4

This is an incorrect copy of the actual code posted by @gigasurfer86763


#5

I understand, but in my case it worked


#6

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