Document indexOf method.