11. Functions Recap - HELP!


#1


Can someone please help! I don't understand what I'm doing wrong! My code just comes back saying there's a problem with my syntax.

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


https://www.codecademy.com/en/courses/javascript-beginner-en-6LzGd/2/3?curriculum_id=506324b3a7dffd00020bf661
Replace this line with your code.


#2

I think you understand how to do functions, right(?), and it looks like it's just formatting issues.


  • You don't need a semicolon after the variable name
  • You have an extra curly bracket, the one at the end isn't needed. It's not closing anything up.

I'm pretty sure that's it. Also, next time, try adding three backticks (`) before and after your code so it's easier to read and keep the formatting. :slight_smile:


#3

Thanks! It's always a silly small error that I end up making!

Appreciate your help! :slight_smile: