我想从数组中删除用户ID(有两个)
const user = {
"_id": "5d6caefdbb6f2921f45caf1d"
}
const allowners = [
"5d6caefdbb6f2921f45caf1d",
"5d6caee9bb6f2921f45caf1b",
"5d6dfcd6e3b11807944348b8",
"5d6caefdbb6f2921f45caf1d"
];
const vendors = []
allowners.forEach((allowner) => {
if (allowner != user._id) {
vendors.push(allowners)
}
})
console.log(vendors, user._id)