Need some help with functions!


#1


Functions > Introduction to functions in JS > meet the functions?> how does a function work? (4)


Followed the template from last excersises but the code comes up with this error message: Oops, try again. There was a problem with your syntax. and SyntaxError: Unexpected identifier


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

foodDemand("apple");


#2

change the "ar" to "var" just looks like you missed a letter


#3

Miss copy pasted that (sorry!) in the actual code i have has it writen as var


#4

the problem here is that you finished your code block (aka curly bracket code) with a semicolon, which you shouldn't do. all you have to do is take that little bit away and save and submit the code and you should be good : )


#5

i hope that helps and good luck learning more!


#6

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