Please Help

Hello, I am in need of your help.

I am currently learning javascript, and whenever I try to make a function, I always get this:


Please help

Hello, @data5108493704, and welcome to the forums. You have a function call as the parameter to your getUserChoice function. I believe for this project, you are supposed to pass a possible user choice to the function to make sure that it is valid. To define an arrow function you would use syntax similar to:

const myFunction = parameter => {
  //function body

Including parenthesis after the name of a function, invokes or calls the function. Including parenthesis after a name that isn’t a function will throw an error:

const name = "Bart";
console.log(name); // prints Bart
console.log(name()); // throws an error: TypeError: name is not a function