This isn’t any point using map here – you’re literally just using it to copy an array. If you want a new array with the new element added, the JS provides the concat method for doing that:
I certainly didn’t mean to imply that using map is the best solution. It’s just one that came to mind when prompted by the challenge, and I was wondering why I couldn’t get it to work.
When I read the w3schools page for the concat method I got hung up on the part that says:
The concat() method is used to join two or more arrays.
It didn’t occur to me that it would work even if the argument passed to it was not an array.