Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

JavaScript JavaScript Foundations Variables Null and Undefined

Lee Frankel-Goldwater
Lee Frankel-Goldwater
6,332 Points

Project error

You have a mistake here in the quiz. It should pass with the == and fail with the ===, you have it the opposite. Oops!

2 Answers

James Barnett
James Barnett
39,199 Points

The code challenge is working correctly. Since null and undefined are different you wouldn't want a identical() to run if the values of 2 variables were actually different.

Null and undefined are different, == does type coercion where === checks for strict equality.

Lee Frankel-Goldwater
Lee Frankel-Goldwater
6,332 Points

Perhaps I read the quiz wrong. It seem the conditional if statement was initially comparing with == and the goal is to get the function within the block to be called. It should NOT run with === but it should run with ==. This seems contrary to the question. Thanks for the reply.