FAQ: Advanced JSX - JSX Conditionals: &&


This community-built FAQ covers the “JSX Conditionals: &&” exercise from the lesson “Advanced JSX”.

Paths and Courses
This exercise can be found in the following Codecademy content:

Web Development

Learn ReactJS: Part I

FAQs on the exercise JSX Conditionals: &&

There are currently no frequently asked questions associated with this exercise – that’s where you come in! You can contribute to this section by offering your own questions, answers, or clarifications on this exercise. Ask or answer a question by clicking reply (reply) below.

If you’ve had an “aha” moment about the concepts, formatting, syntax, or anything else with this exercise, consider sharing those insights! Teaching others and answering their questions is one of the best ways to learn and stay sharp.

Join the Discussion. Help a fellow learner on their journey.

Ask or answer a question about this exercise by clicking reply (reply) below!

Agree with a comment or answer? Like (like) to up-vote the contribution!

Need broader help or resources? Head here.

Looking for motivation to keep learning? Join our wider discussions.

Learn more about how to use this guide.

Found a bug? Report it!

Have a question about your account or billing? Reach out to our customer support team!

None of the above? Find out where to ask other questions here!


I am confused with the && operator in JSX.


What part of it are you confused by?

I think it’s something like

x && <jsx></jsx>

if x evaluates to true, the JSX element will render. If it evaluates to false, nothing renders


@javaslayer94101, thank you very much, that’s what I am confused.

Here is what I am thinking, the code below will evaluate to true or false. Why the <jsx></jsx> element is render when x is true.

x && <jsx></jsx>

I will spend more time to be comfortable with this coding style. I think I lack some basic knowledge about JavaScript.

Have a good day.


… Your example has { !baby && <li>Pizza</li> }

But it marks it as a fail if you put { !judgmental &&

  • Nacho Cheez Straight Out The Jar
  • }

    Am I missing something? Your answer is the exact same thing except without the spaces between the curlys and the contents???


    No you’re not. Getting the same error. Unfortunately the React course is PACKED with these “bugs”. They only accept the answer if it’s matches their’s to the dot.