Pergunta de entrevista da empresa Wunderkind

Write a JS function that mimics the functionality of indexOf