Array.prototype.findLastIndexintermediateconst items = [{ok:true},{ok:false},{ok:true}]
items.findLastIndex(i => i.ok) // β 2Use findLastIndex() to find the position of the last object matching a property check.
findLastIndex() with object arrays lets you locate the index of the last object satisfying a property condition.
Challenge: Implement lastActiveIndex(users) that returns the index of the last user with active: true.
lastActiveIndex([{active:false},{active:true},{active:false},{active:true}]) // β 3
lastActiveIndex([{active:false}]) // β -1