Hello everyone!

Please help me to understand.

Or have I misunderstood or it's a misprint. (Though probably misunderstood)

The documentation says that

str.indexOf(searchValue[, fromIndex])

*searchValue* - is, as I understand it, a piece of string, a start index where you need to find a string

and *fromIndex* is the index where we should start the countdown.

QUESTION:

`'Blue whale'.indexOf('whale', 0); // returns 6`

Need to find the index of the beginning of the word "kit" in a line "Blue whale", where the reference point is index 0 Turns 6.

S - 0, I - 1, n - 2, I - 3, j - 4, gap - 5, K - 6.

This is understandable.

---

Why here the answer is also 6, when the starting point is the index of 5?

'Blue whale'.indexOf('whale', 5); // returns 6

Where is the account? Something I do not understand )

Here's another:

'Blue whale'.indexOf(", 9); // returns 9

'Blue whale'.indexOf(", 10); // returns 9

Why 9?

Thank you in advance!