Open binarykitchen opened 8 years ago
There is an undocumented function keepIndexed
that you can use in this fashion:
const kept = mori.keepIndexed((idx, string) => string === referenceString ? idx : null, strings)
const matchingIndex = mori.first(kept)
thanks @hallettj but why is it undocumented?
I don't know why keepIndexed
is not documented. I happened to get a pretty good look at that and other unadvertised functions while assembling type definitions for Mori.
This seems to be missing ... thanks for any hints