I would like ot use conditional inside a filter() function in vuejs, but i got an error after || if
This is my code :
return this.produits.filter((item) => {
return (
item.codeproduct == this.codebar ||
if (item.produitbrand) {
for (let i = 0; i < item.produitbrand.length; i++) {
if (item.produitbrand[i].brandsubproduit) {
for (let e = 0; e < item.produitbrand[i].brandsubproduit[e].length; e++) {
item.produitbrand[i].brandsubproduit[e].codeproduct == this.codebar
}
}
}
});
})
Any orientation ? Thank you.
Update : This is my error :

ifis a statement. You cannot use it with||as part of an expression