refactor(indexOf) Remove a now unused copy of the indexOf function

This was missed in 300bffc4fe1ef664576abb39d2f6671b11813986

Closes #8939