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.
Very similar in pilosophy to my first Solution.
I have two solutions, second is onliner recursive, first is iteration
I wrote this solution. I can tell you it breaks two tenets of javascript best practices of old: (1) avoid the comma operator and (2) always delimit blocks with curly braces. Whether these are still as relevant now as they were then is debatable.
I've always held that the comma operator has its place in loop conditions. You should get acquainted with it. But in this case it's the wrong tool for the job. I've virtually never used it before, but I think this is a case for the
do ... while
loop.Is this while loop really "Best Practices"? Made me scratch my head for a while.