I'm working on nodejs and I want to check if my object property is not null when uses a filter :
propositions = propositions.filter((prop) => {
return prop.issuer.city.equals(req.user.city._id);
});
prop.issuer may be null some time and I want to avoid this comparison when it's null!
I tried this but it's not worked :
propositions = propositions.filter((prop) => {
return prop.issuer?.city.equals(req.user.city._id);
});
?.*is not currently supported in node.js.