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.
ternary better only for small,simple functions
In the company I work with, the way our project is set up in REACT is that nested ternary won't pass pipeline build.. Also Prettier will get upset I think.. Although this solution looks clever and damn good as hell, readabiliy is also important.
Love the thought, but I respectfully disagree. Just because you aren't learning how to run a loop in this solution doesn't mean you aren't learning. Learning a) how to use regex and b) how to be efficient and clean in your code IS learning. And I would think it's more valuable than learning a method for this specific instance that takes up way more space. But I understand your point. Key takeaway here is that everyone is using this platform to learn something different. For instance, loops are easy for me, but regex has always been confusing. This solution offered me the chance to use regex, and I felt very accomplished in doing so. Anyway, best of luck with your learning!
This comment is hidden because it contains spoiler information about the solution