Array.prototype.findLastIndexbeginnerconst arr = [1, 2, 3]
arr.findLastIndex(n => n > 10) // β -1 (not found)findLastIndex() returns -1 when no element satisfies the predicate.
Like all index-returning methods, findLastIndex() returns -1 when no element satisfies the predicate.
Challenge: Implement lastNegativeIndex(nums) that returns the index of the last negative number, or -1 if none.
lastNegativeIndex([1, -2, 3, -4]) // β 3
lastNegativeIndex([1, 2, 3]) // β -1