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