Question d’entretien chez Wunderkind

Write a JS function that mimics the functionality of indexOf