I keep getting syntax errors on correct code!


#1

I am doing Introductions to Functions part 11 and it keeps saying SyntaxError: Unexpected token (
My code looks correct, if someone could help that would be great! Here's my code:

var nameString = function (name) {
return "Hi, I am" + " " + name;
};
var nameString (Alex);
console.log (nameString);


#2

That just happened to me. It is the right code. Copy the code and then log off. Once you are logged off, scroll to the bottom and press Javascript(It is a link in the very bottom). Paste your code once you get there. It should say you got it right. If it did say you got it correct the log back in and you have completed the lesson.


#3

Hi here

var nameString (Alex);
console.log (nameString);

You want to call the function nameString you don't need of var before the function and then your name should be inside " " like that

nameString("Alex");