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.
Completely agree, I tend to use else for readability. Thanks for commenting!
You don't actually need the else statement here.
If the first return statement runs, the function will be exited, and the second return statement will not run.
That said, I can see why you'd include the else statement for readability.
As
body[-1]
is the last element, the:
is redundant. You could also return the condition:or even: