Need some help with functions!


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);



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


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


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 : )


i hope that helps and good luck learning more!


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