Array.prototype.findintermediateconst pts = [{x:1,y:1}, {x:2,y:3}, {x:3,y:4}]
pts.find(p => p.x + p.y > 4) // β {x:2, y:3}Use find() with a complex predicate to locate an object satisfying multiple conditions.
find() predicates can be as complex as needed. Multiple conditions can be combined with && to narrow the search.
Challenge: Implement findInRange(nums, lo, hi) that returns the first number between lo and hi (inclusive).
findInRange([1, 5, 3, 8, 6], 4, 7) // β 5
findInRange([1, 2, 3], 10, 20) // β undefined