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.
@jonadair me too, I prefer the top solution I commented on when I didn't know enough about .map()
I would actually find that harder to follow than the common one-liner arrow func and ternary
At the time I didn't understand Js enough altogether to get why this is the best way to do it. I understood each part individually, but didn't quite get the bigger picture of it. I hope I explained myself well.
I don't know but if you understand map properly, this one should be ablt to easily undertood and reed in my opinon.
Thanks for the support
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.
It's all in one line. Not easy to read at all. Clever code isn't best practice
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.
How did this get 1.45k best practices votes, it's not practical at all. It is clever, very, but so far from 'best practices'