I was about to ask if you meant a key as in an index in the array. I forgot that Arrays are objects in JavaScript, as pretty much everything else. But still, I am not sure what you mean by the function executing on a key.
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.
Just so I'm clear as a junior:
map()
does not mutate an array just makes a new one?Correct, array.map returns a new array that will not mutate your old one.
You could conceivably alter your original array while in the function executing on a key, but then you're out of the realm of using
I was about to ask if you meant a key as in an index in the array. I forgot that Arrays are objects in JavaScript, as pretty much everything else. But still, I am not sure what you mean by the function executing on a key.