This is a test of finding string length

Find the location of the string "by the dawn's early light" in the string "Oh say can you see, by the dawn's early light"

The answer below tells you where the first character is located in the search string, it will make a difference later

Knowing how Javascript counts is important. It starts with zero (0). So the "O" in "Oh" is in the zero postition.
Now we are going to slice "by the" out of the phrase "by the dawn's early light".
In order to remove the slice we need to find where the slice will start, where it will end, and that will tell us the postions of the slice.

We use the Javascript command ".indexOf" to find the starting position.

Now that we know where it starts we can count up to find how big the slice needs to be, but that is not how programmers should do it. However, for now that is what we will do. So, 20 is where the "by" starts, and 26 is where "the" ends

it is worth revisiting..."by" is in position 20..and "the" ends in position 26. Remember we begin counting with the first character of the phrase being at position zero.