I am quite stuck in a refactored ternary operator while learning react. Here is the code I came across inside a JSX:
{props.openSpots === 0 && <div className="card--badge">SOLD OUT</div>}
I would like to ask why this will return the card--badge div? I am only familiar with the complete common ternary operator that looks like this instead:
{props.openSpots === 0 ? <div className="card--badge">SOLD OUT</div> : null}
Thank you very much.