📜  array.filter async - Javascript 代码示例

📅  最后修改于: 2022-03-11 15:03:20.807000             🧑  作者: Mango

代码示例1
const asyncFilter = async (arr, predicate) => Promise.all(arr.map(predicate))
    .then((results) => arr.filter((_v, index) => results[index]));