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. A bit cleaner than mine, I'll admit.
This comment is hidden because it contains spoiler information about the solution
You're correct, it's best to use
let
in nearly all cases, unless you know what you're doing. I suspect that many of these solutions are old, posted either beforelet
was introduced, or prior to its widespread usage.This comment is hidden because it contains spoiler information about the solution
This comment is hidden because it contains spoiler information about the solution
There can be no room for debate that this is best practice
Very silly of me to forget repeat() exists, so thanks for the reminder!
Isn't it considered bad practice to modify states outside using setState()?
I pity the foo' who tries this without regular expressions.
Isn't it easier to decrement i and simply use that as the index, instead of incrementing it then subtracting that from the length to calculate the index in the loop body? (I.e. i-- instead of i++.)