-
Notifications
You must be signed in to change notification settings - Fork 0
some
김태헌 edited this page Sep 26, 2024
·
3 revisions
import { some } from 'mori-ts';
const arr = [1, 2, 3, 4, 5];
const result = some(item => item > 3, arr);
console.log(result); // true
import { pipe, map, filter, some, toAsync } from 'mori-ts';
const result = pipe(
[1, 2, 3, 4, 5],
map(item => item * 2),
filter(item => item > 5),
some(item => item > 10)
);
console.log(result); // false
const result2 = pipe(
[1, 2, 3, 4, 5],
toAsync,
map(item => item * 2),
filter(item => item > 5),
some(item => item > 10)
);
console.log(result2); // false
https://github.com/gangnamssal/mori-ts/blob/main/src/test/some.spec.ts