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.
жест
loser
ugly, but cool at the same time
loser
loser
Ah JS. "Never let them guess your next move." Thx for pointing this out.
It's polyfill and that's how standard
.indexOf
works, ex.'asd'.indexOf('', 10) == 3
so makes sense.Does it make sense when you search for empty string with a
startIndex
greater than the string length to say you 'found' it at string length? I would consider it to return-1
in this case because you cannot find anything out of bounds, not even nothing.damn it, I read "shouldn't"... XD
my mistake, sorry
I provided even more detailed description, can you check it please
Check out how native js
String.prototype.indexOf
method works, it can convert an array to string, from[-1, -2, -3]
to-1,-2,-3
or number to string before trying to find an index.Actually the same thing for booleans, what will happen with
true + ""
, right'true'
Hi,
What does that mean? What the function is supposed to return when it's not a string? => missing specification
Cheers
Good enough, but I think it's odd we could search for an empty needle in a non-empty haystack.
I provided a detailed description to the edge cases
yes, it should've been stated before that
startIndex
with negative value should be searched normally from the first index, where the JS indexOf would have been treat it to search from the offset of the last index.Loading more items...