Array.prototype.indexOfbeginnerconst words = ['cat', 'dog', 'bird']
words.indexOf('dog') // β 1
words.indexOf('fish') // β -1Use indexOf() to find the index of a specific string in an array.
indexOf works with string arrays too, using case-sensitive strict equality.
Challenge: Implement findWord(words, word) that returns the index of word in the array.
findWord(['foo', 'bar', 'baz'], 'bar') // β 1
findWord(['foo', 'bar'], 'qux') // β -1