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

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.