Commit 11e62be8 by Vladislav Lagunov

Добавлен findMap

parent 9dedf5f9
/**
* Комбинация `Array.prototype.find` и `Array.prototype.map`
*/
export default function findMap<A, B>(xs: A[], f: (a: A) => B|undefined): B|undefined {
for (const x of xs) {
const b_or_undefined = f(x);
if (b_or_undefined !== undefined) return b_or_undefined;
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment