Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

JavaScript JavaScript Foundations Variables Null and Undefined

why is it ===?

the code challenge answer is myNullVariable === myUndefinedVariable. Can someone please help me understand this?

From my understanding === is a strict compare i.e. comparing results and data type. in this case myNullVariable is set to null and when using strict compare is never equal to myUndefinedVariable. Anybody can help?

Hi, not sure but what i know the === need to be exactly =eaqul= to the other variable so its like password it will be === stricked . If you wanted to know that not sure

2 Answers

Aaron Graham
Aaron Graham
18,033 Points

You are right about how they operate. I see this question come around the forums from time to time, and it's usually confusion over what the challenge is actually asking you to do. Here is a link to a recent discussion about this challenge: https://teamtreehouse.com/forum/isnt-going-to-be-more-likely-to-equal-a-true-value-than-bit-confused-on-this-test

Hope that helps

Thanks Aaron. That link gave the answer to the same question :)