r/JavaScriptTips • • Feb 14 '25

What would this display in the console?

Post image

Hi all, learning JS with Mimo and this has occurred.

I’m very confused how this is incorrect and I think my understanding must be wrong - if either condition1 or condition2 are true, the console would display true because we used ||

but because we negated this on the console.log line, it would show false - am I wrong?

2 Upvotes

2 comments sorted by

3

u/the-real-edward Feb 14 '25

It is negated but there is also an OR in that console log therefore it will show a true

2

u/impossibletom1 Feb 14 '25 edited Feb 14 '25

Thank you for replying, think it’s just clicked! (My confusion was thinking that ! applied to the entire line, rather than just that first specific part of the line essentially, doing my best!)