Loading collection data...
Collections are a way for you to organize kata so that you can create your own training routines. Every collection you create is public and automatically sharable with other warriors. After you have added a few kata to a collection you and others can train on the kata contained within the collection.
Get started now by creating a new collection.
I would actually find that harder to follow than the common one-liner arrow func and ternary
This comment is hidden because it contains spoiler information about the solution
I don't know but if you understand map properly, this one should be ablt to easily undertood and reed in my opinon.
Apparently, this site's community thinks less lines of code is "better", and there's not much of an understanding of readability or maintainability for these exercises... The mindset's divorced from practical coding, by and large.
I think advanced array methods, arrow functions, and the ternary operator (?) would be considered best practice.
The comments linking to MDN are quite nice too.