Can someone explain Lesson 12: &&?


#1

There are two posts about this already, but neither of them focused on the part I am confused about or answered it adequately.

The question contains this code:

    {!judgmental && <li>Nacho Cheez Straight Out The Jar</li>}

To simplify it, I ran these tests:

console.log(false && 'test')

false

console.log(true && 'test')

test

Can someone explain this? Why wouldn’t the result always be either true or false since it is a condition?


#2

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.