What I can do:
const val = array.find((val) => <condition>);
const index = array.indexOf(val);
What I'd like to do:
const { val, index } = array.someFunc((val, index) => <condition> && { val, index });
Anything like this out there? some() is reduced to a boolean, and find() just returns the array element, but neither fit the use case.
mapthenfind?Array.findIndex()that would reduce some effort