Tell us what’s happening:
There have been quite a few lessons/challenges, where I struggled with what I perceived as incomplete explanations (from a beginner’s point of view). But the explanation (and even one solution) for this one drove me to create this thread.
Unless I missed some major lessons, functions only ever took arguments from the function calls. Then suddenly this sentence appears in the explanation:
When the callback is used, it is passed three arguments. The first argument is the current element being processed. The second is the index of that element and the third is the array upon which the
map
method was called.
Maybe a pro understands what that means, but from my knowledge as a beginner, that sounds as if I have to (or am able to) pass three arguments into the function (from where though?). And then in the solution suddenly there is “item” as an argument and I have to wonder, where that comes from. It isn’t passed into the function. So I wonder if this is a set expression, but that is not explained anywhere either.
Just after lengthy outside research I find out, that for the first time in FCC the arguments just appear out of thin air but I still have to make up names for them. As if any of that would make sense, coming from previous lessons.
So I would strongly suggest giving more detailed explanation of what is happening here, how to use the arguments and the fact that you have to name them, but not pass them into the function. And show it in an example. This type of stuff is in no way clear or obvious to a noob like me. It just makes me really frustrated with the “teacher” (FCC).
So I look at the solutions and finally understand solution 1, but then there is solution 2 and suddenly there is an argument call that is… what? An object? Why? And how? I thought the arguments of a map function automatically are item, index and the array? Does this get overwritten, if I pass in an object? And what happens with this object in this function? NONE OF THIS IS EXPLAINED!!! (And I still don’t get it)
Sorry for “shouting” but this kind of stuff is really frustrating as a learner. Many, many lessons befor this one already had solutions that used map() without ever explaining it. Now we finally get an explanation but it is so confusing and incomplete, that it really stops all learning momentum in its tracks.
So please, please, please consider expanding this lesson.
Thank you!
Challenge: Use the map Method to Extract Data from an Array
Link to the challenge: