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 trialMichael Jasinski
7,427 PointsisStudent message. else if
I am having an issues with this part. I think I have the correct I have looked at others answers and it looks correct, but I guess not.
Any Ideas here?
var isAdmin = false;
var isStudent = true;
if ( isAdmin ) {
alert('Welcome administrator')
} else if (isStudent){
alert('Welcome Student');
}
<!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>
5 Answers
pi R
12,720 PointsYou have a typo on the alert message: it should be "Welcome student" and you typed: "Welcome Student" (change the S => s)
Abe : no need to add ===true, the variable is declared as true at the top;
edit: ahh.. 3 minutes late after privacypls ;)
Abe Layee
8,378 PointsThe question is asking to test if isStudent is true. I mean you got most of the code correct except you forgot to add the true statement.
var isAdmin = false;
var isStudent = true;
if ( isAdmin ) {
alert('Welcome administrator')
} else if (isStudent===true;){ //is student set to true?
alert('Welcome Student');
}
privacypls
2,478 PointsIs the answer case sensitive? Try changing....
javascript alert('Welcome Student');
to:
javascript alert('Welcome student');
Mat Morris
10,292 PointsThe answer is case sensitive. If you type 'Welcome Student' it WILL NOT work. I did that.
Michael Jasinski
7,427 PointsThank you all for the help on this! Sometimes you just have to rework the wording.