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.
Nice practice.
Exactly as Jotha said, that was my reasoning. Return does the same as break here.
Because a
return
is technically abreak
, except it breaks the whole function.Jotha gave you the best explanation. Also check on Mozila website for javascript documentation ;)
A
break
only exits theswitch-case
statement. On the other side areturn
exits the whole method, so this is valid, too. As you can see, in any case there will be a returned value.Why didn't you type 'break' in each case? Is it not necessary?