What is the parameter in the arrow function syntax given below?

Tell us what’s happening:
I am just trying to review concepts so that I can learn to understand javascript. This is an isolated example compared to my other question about for loops, as I was suggested to review the material.Maybe I’ll even do the javascript section again.
I want to return to free code camp once I review the basics to test my knowledge.

Your code so far


Here are the two methods
fruits.forEach(function(ChosenFruit){
  console.log(' I want to eat a ' + ChosenFruit);
});

fruits.forEach(fruit => console.log('I want to eat a ' + fruit)); ///is the parameter fruit?

fruits.forEach(function(ChosenFruit){      //the paramater is ChosenFruit here?
  console.log(' I want to eat a ' + ChosenFruit);
});

///potentially lacks a closing curly brackets
  // Only change code below this line.

fruits.forEach(fruit => console.log('I want to eat a ' + fruit))

fruits.forEach(function(ChosenFruit){      //the paramater is ChosenFruit here?
  console.log(' I want to eat a ' + ChosenFruit);

///potentially lacks a closing curly brackets

Your browser information:

Your Browser User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/63.0.3239.132 Safari/537.36.

Link to the challenge:
https://www.freecodecamp.org/challenges/declare-javascript-objects-as-variables

///is the parameter fruit?

Yes

Is the following example now corrected?

[quote=“randelldawson, post:5, topic:172222”]
fruits.forEach(function(ChosenFruit){ // the paramater is ChosenFruit here?
console.log(’ I want to eat a ’ + ChosenFruit);
});

Is this the correct use of closing and beggining brackets when I use a function? I ask because I am trying to get over this maladaptive pattern.

I think I quoted you here.

Where are you writing your code at the moment? A ‘proper’ editor, like Atom or VS Code will help you to match your brackets and braces and to indent your code properly, which will help a lot with syntax issues.

Yes. I think I understand how to do it. Some of this is just practice unfortunately. But im aware of jsbin