So I'm looking at function expressions.
This is the code I'm playing with:
var modifiedNames = [ "Thomas Meeks",
"Gregg Pollack",
"Christine Wong",
"Dan McGaw" ];
modifiedNames.map(function(cheese) {
alert("Yo, " + cheese + "!");
});
It works fine but I'm having trouble understanding part of it. I grasp what .map
is doing but the parameter is really throwing me. How is the parameter collecting the array's information? I called it cheese as that's just my go-to test word.
I have read a couple of explanations but I'm just not grasping it, hoping somebody here could simplify the explanation somewhat. Thank you.