The description of the fromIndex parameter says that if the parameter is >= than str.length the method returns -1, but that is false.
That is actually correct.
Having a fromIndex equal or greater than length means that the search will start after the last character of the string, which doesn't make sense. Remember that fromIndex starts at 0.

Oh, sorry, i initially thought it worked like that, but then i got confused because of this one example where it returned 10 even though fromIndexwas > than length, and after some testing i now understand that it didn't return -1 because the string it was looking for is an empty string, and in that case apparently it just returns the length of the string. Thanks for the answer!

Hum, you do have a point, though:

So, when searching for an empty string, it behaves somewhat unpredictably.
Yeah, i guess there is some sort of an error after all! Well, thanks again for the answers!
This is an interesting case — I do agree that the behavior and wording here is a little confusing.
I've done some testing and added some wording to
Does this help?
For me it's perfect.
I can try to update the Portuguese version myself, or I can leave that with you specialists :+1:.
@Leokuma cool, I'm glad it is helpful!
For the pt-BR, I'm sure you write much better Portuguese than any of us ;-) We have no Portuguese speakers on the team.
I updated the pt-BR page.
Most helpful comment
@Leokuma cool, I'm glad it is helpful!
For the pt-BR, I'm sure you write much better Portuguese than any of us ;-) We have no Portuguese speakers on the team.