In reply to prashantg:
All of the find methods return an array because the source array could be empty. Returning -1 is not an option because that is a potential valid index.
In reply to prashantg:
All of the find methods return an array because the source array could be empty. Returning -1 is not an option because that is a potential valid index.