will be helpful for those in need Yes, you can use ternary condition ? "yes" : "no" for your shorthand if else. Your code looks good, you can remove the condition Name && Category from the below snippet since you're doing Name ? html : '' and Category ? html : '' already!
it fixes the issue Writing if (x) checks whether x is truthy – any value except 0, '', false, null, NaN, or undefined. This is done the same way whether x is a boolean or some other value, and is not related to coercing ("loose") equality.