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![](https://ecs-static.teamtreehouse.com/assets/views/marketing/shared/community-banner-white-47072046c51352fe6a69f5e691ff5700b28bb11d45197d7bdf066d9ea3f72d0c.webp)
![Michael Mountain](https://secure.gravatar.com/avatar/1802e0c37f309e3e7c997feee8752191?s=96&d=https%3A%2F%2Fecs-static.teamtreehouse.com%2Fassets%2Fcontent%2Fdefault_avatar-445fbbabfc8dc9188fb5967fe43322ee0c3e0dd1e10f378bf8343784af5a13eb.webp&r=pg)
Michael Mountain
3,022 PointsHelp with Null and Udefined
var myVar;
undefined = true;
console.log(typeof myVar);
console.log(myVar === undefined);
the last console.log is not returning false like it is in the video. why?
4 Answers
![Sander de Wijs](https://uploads.teamtreehouse.com/production/profile-photos/118727/micro_Sander_new.jpg)
Sander de Wijs
Courses Plus Student 22,267 PointsThe result your are seeing is correct. There is no value defined for myVar so it is undefined. Did Jim put undefined in quotes in the video?
Then the outcome would be false because because myVar does not equal the String or word 'Undefined'. It is just the undefined value (or missing value) of the variable myVar.
![Eric Dietrich](https://secure.gravatar.com/avatar/f3f615c738ac415e187de9590b685f9a?s=96&d=https%3A%2F%2Fecs-static.teamtreehouse.com%2Fassets%2Fcontent%2Fdefault_avatar-445fbbabfc8dc9188fb5967fe43322ee0c3e0dd1e10f378bf8343784af5a13eb.webp&r=pg)
Eric Dietrich
Courses Plus Student 5,897 PointsI ran into this error last night myself. The missing piece is in the first console.log
=== "undefined"
var myVar;
undefined = true;
console.log(typeof myVar === "undefined");
console.log(myVar === undefined);
![Michael Mountain](https://secure.gravatar.com/avatar/1802e0c37f309e3e7c997feee8752191?s=96&d=https%3A%2F%2Fecs-static.teamtreehouse.com%2Fassets%2Fcontent%2Fdefault_avatar-445fbbabfc8dc9188fb5967fe43322ee0c3e0dd1e10f378bf8343784af5a13eb.webp&r=pg)
Michael Mountain
3,022 Pointshere is the video where he does it: http://teamtreehouse.com/library/javascript-foundations/variables/null-and-undefined
Sanders if the keyword undefined is = to true then myVar being undefined is not equal to to it right? isn't this what Jim is saying in the video?
Eric if i copy your code or if i copy Jim's code the both return true unlike Jims? can it be that we can no longer define the keyword undefined? even Jim says that its stupid that we can define it...?
thanks for your help
![Eric Dietrich](https://secure.gravatar.com/avatar/f3f615c738ac415e187de9590b685f9a?s=60&d=https%3A%2F%2Fecs-static.teamtreehouse.com%2Fassets%2Fcontent%2Fdefault_avatar-445fbbabfc8dc9188fb5967fe43322ee0c3e0dd1e10f378bf8343784af5a13eb.webp&r=pg)
Eric Dietrich
Courses Plus Student 5,897 PointsWow...after redoing the lesson I see exactly what you are talking about. I think that I might have missed that the first time when I was going through the video.
The elimination of defining "undefined" would be the only logical answer.
Sebastian Lozowski
5,687 PointsI'm on the lesson right now and I have the exact same issue. It's not returning false. Jim missed something.