Emulating find() and findIndex() with reduce()