我对lodash和JavaScript一般都是新手。 我正在使用nodejs。 我正在使用lodash过滤函数来过滤我的集合中的一些内容。
这里是代码片段
filteredrows = _.filter(rows, function(row, index){
//here I need to call some asynchronous function which checks the row
//the return value of this asynchronous function will determine whether to return true or false for the filter function.
});
我的问题是,我该如何做到这一点?使用闭包吗?在lodash过滤函数内是否可能实现此功能? 提前致谢。
_.filter
。 - Felix Kling