String.prototype.lastIndexOfbeginnerconst str = 'abcabc'
str.lastIndexOf('a') // β 3
str.lastIndexOf('z') // β -1
str.lastIndexOf('b', 3) // β 1Use lastIndexOf() to find the index of the last occurrence of a substring, searching from right to left.
When there are multiple matches, .lastIndexOf() returns the rightmost one.
Challenge: Implement lastOccurrence(str, ch) using .lastIndexOf().
lastOccurrence('abracadabra', 'a') // β 10