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)
![Ryan Lee](https://uploads.teamtreehouse.com/production/profile-photos/2258822/micro_20150909_214542.jpg)
Ryan Lee
13,806 PointsSyntaxError: Parse error on Challenge Task 1 of 1 "Add a final else clause"
Tried looking on the forums for this, as far as I can tell my code is correct but I am getting a syntax error "Parse error". Here's the code:
var isAdmin = false; var isStudent = false;
if ( isAdmin = true ) { alert('Welcome administrator') } else if ( isStudent = true ) { alert('Welcome student') } else { alert('Who are you?')
Can anyone help me with this one?
var isAdmin = false;
var isStudent = false;
if ( isAdmin = true ) {
alert('Welcome administrator')
} else if ( isStudent = true ) {
alert('Welcome student')
} else {
alert('Who are you?')
<!DOCTYPE HTML>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>JavaScript Basics</title>
</head>
<body>
<script src="script.js"></script>
</body>
</html>
1 Answer
![Jason Anders](https://uploads.teamtreehouse.com/production/profile-photos/3512822/micro_Jason_s-Pic.jpg)
Jason Anders
Treehouse Moderator 145,859 PointsHi Ryan. You've got everything right, you are just missing your closing curly brace after the final alert to close the last else statement. Keep Coding! :)
Ryan Lee
13,806 PointsRyan Lee
13,806 Pointsyikes, how embarrassing. I spent a good 15-20 minutes looking at this too -_-. Thanks for the help!
Jason Anders
Treehouse Moderator 145,859 PointsJason Anders
Treehouse Moderator 145,859 PointsHey Ryan. No worries and nothing embarrassing. Even the most experienced coders make the simplest mistakes that usually a fresh set of eyes can catch easily. :)
Also, on a side note, in the forum, it is a good practice to mark "Best Answer" if your question/problem was solved, as this lets others in the forum know your question/problem is resolved.
Enjoy your Treehouse Experience. :)