React · Junior · Question 64 of 75
What do {false}, {null}, {undefined} and {0} render in JSX?
- ✓Correct answer: Nothing for the first three, but
0is rendered as text - 2All four render nothing
- 3They render the words "false", "null", "undefined" and "0"
Explanation
Booleans, null and undefined are ignored. Numbers (including 0) and strings are rendered, which is why {items.length && <List />} can show a stray 0.