Array.prototype.findIndexbeginnerconst arr = [1, 2, 3]
arr.findIndex(n => n > 100) // β -1 (not found)findIndex() returns -1 when no element satisfies the predicate β always check for this.
When no element satisfies the predicate, findIndex() returns -1. This is consistent with indexOf() and lastIndexOf().
Challenge: Implement findGtHundred(nums) that returns the index of the first number greater than 100, or -1 if none.
findGtHundred([10, 200, 50]) // β 1
findGtHundred([1, 2, 3]) // β -1