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 trialCarson Clark
2,159 PointsI can't get past the identical() challenge..
I understand they don't wish for the identical function to execute since the two variables are not equal, so I added the strict operator but it still doesn't work and I'm not sure why.
<!DOCTYPE html>
<html lang="en">
<head>
<title> JavaScript Foundations: Variables</title>
<style>
html {
background: #FAFAFA;
font-family: sans-serif;
}
</style>
<script src="ignore_this.js"></script>
</head>
<body>
<h1>JavaScript Foundations</h1>
<h2>Variables: Null and Undefined</h2>
<div id="container">
</div>
<script>
var myUndefinedVariable =;
var myNullVariable = null;
if(myNullVariable === myUndefinedVariable) {
identical();
}
</script>
</body>
</html>
1 Answer
Aaron Graham
18,033 PointsThe line:
var myUndefinedVariable =;
is not a valid assignment. I think in the challenge it just has this;
var myUndefinedVariable;
The difference is the equal sign. If you have an equal (assignment operator) you need to have a valid expression on the right side.
Carson Clark
2,159 PointsCarson Clark
2,159 PointsThanks, that was the issue!