String.prototype.indexOfbeginnerconst str = 'hello world'
str.indexOf('world') // β 6
str.indexOf('xyz') // β -1
str.indexOf('l') // β 2Use indexOf() to find the index of the first occurrence of a substring, returning -1 if not found.
str.indexOf(searchValue) returns the index of the first occurrence of searchValue, or -1 if not found.
Challenge: Implement findFirst(str, sub) that returns the index of sub in str.
findFirst('hello world', 'world') // β 6
findFirst('hello', 'xyz') // β -1