Appearance
异步过滤数组元素。
import { filterAsync } from '@base-web-kits/base-tools-ts'; const array = [1, 2, 3]; const result = await filterAsync(array, async (n) => n % 2 !== 0); // 结果: [1, 3]
collection (Array)
predicate (Function)
(Promise<Array>)