Techincally yes, but my point was that by assigning that function to a named variable, you get a much more natural, readable expression: people.map(toViewModel)
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
Point 4. I think both of these functions are anonymous. The second one is function expression with anonymous function if I'm not mistaken
Techincally yes, but my point was that by assigning that function to a named variable, you get a much more natural, readable expression:
people.map(toViewModel)