0
我想用lodash簡化這個函數,但是我不知道該怎麼做才能幫助我?用lodash簡化表達式
function _findMembers(usersAvailable,listOfUsers){
console.log("listOfUsers")
console.log(listOfUsers)
var members = [];
for(var i=0; i<_.size(usersAvailable);i++){
for(var j=0; j<_.size(listOfUsers); j++){
if(usersAvailable[i].local.email == listOfUsers[j]){
var user = usersAvailable[i];
user.selected = true;
members.push(user);
}
}
}
console.log("members")
console.log(members)
return members;
}