I have the following condition.
if (!product.tag_id) {
return;
}
How can I change it in a way that for the tag_id which is equal to 0 it will not return wrong thing. Now it considers tag_id:0 as false value and returns nothing. How can be it fixed?
if (!product.tag_id && product.tag_id !== 0) return;
// Do something else
This checks for if the product tag id is not equal to zero before returning.