JavaScript · Junior · Question 63 of 75

What does 0 && "hello" evaluate to?

Explanation

&& returns the first falsy operand or the last one. In JSX, {count && <Badge />} therefore renders 0 when count is 0.

Further reading

Problem with a question

JavaScript · Junior · question 63

Test yourself

Take the JavaScript · Junior quiz: questions and options are shuffled, and you get a review of your mistakes at the end.

Take this quiz