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)
![removejackdonley](https://secure.gravatar.com/avatar/e52d3e91d62f3384ae05655ba18aee07?s=96&d=https%3A%2F%2Fecs-static.teamtreehouse.com%2Fassets%2Fcontent%2Fdefault_avatar-445fbbabfc8dc9188fb5967fe43322ee0c3e0dd1e10f378bf8343784af5a13eb.webp&r=pg)
removejackdonley
2,829 Pointsundefined = true;
Hello everybody,
During the video, Jim shows how to implement a line of code, undefined = true; , which causes the two messages in the console to say: true false. I copied everything correctly, but the messages in the console still read: true true, as if that line of code was commented out. Have any suggestions? Gabriel
3 Answers
![Sean T. Unwin](https://uploads.teamtreehouse.com/production/profile-photos/77880/micro_sean-swglance-02-bw-165x165.jpg)
Sean T. Unwin
28,690 PointsModern browsers, as per the EMCA 5 spec[1], undefined
is read-only and not able to be editable. You would have to use an older browser version from probably a couple of years ago, or possibly even IE<9 for this to work as described in the video.
So that part of the video, while making a good point about not taking variable values for granted, is out of date for that particular snippet of code.
![Sean T. Unwin](https://uploads.teamtreehouse.com/production/profile-photos/77880/micro_sean-swglance-02-bw-165x165.jpg)
Sean T. Unwin
28,690 PointsPlease post your code.
![removejackdonley](https://secure.gravatar.com/avatar/e52d3e91d62f3384ae05655ba18aee07?s=96&d=https%3A%2F%2Fecs-static.teamtreehouse.com%2Fassets%2Fcontent%2Fdefault_avatar-445fbbabfc8dc9188fb5967fe43322ee0c3e0dd1e10f378bf8343784af5a13eb.webp&r=pg)
removejackdonley
2,829 PointsHere it is:
var myVar;
undefined = true;
console.log(typeof myVar === "undefined"); console.log(myVar === undefined);
var x = null;
if(myVar == null){ console.log("If"); } else { console.log("Else"); }
removejackdonley
2,829 Pointsremovejackdonley
2,829 PointsThank you! That totally makes sense.