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 trialKeith Mallett
2,891 PointsAlert Dialog Box
When testing my answer I get " I don't see "Welcome Student" in the alert box. Although Alert box pops up with Welcome Student in it.
Not sure what I am doing wrong.
var isAdmin = false;
var isStudent = true;
if ( isAdmin ) {
alert('Welcome administrator')
} else if ( isStudent = true) {
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>
2 Answers
Samuel Durkin
48,402 PointsTry uncapitalising "Student".
huckleberry
14,636 PointsThis works just fine for me and I'm a bit confused about your question
When testing my answer I get " I don't see "Welcome Student" in the alert box. Although Alert box pops up with Welcome Student in it.
You say that you don't see Welcome student but rather you get an empty string in the alert box. But in the very next sentence you say that you DO get the alert box that pops up and it does indeed say Welcome Student.
soooo ... which is it? lol
Cheers,
Huck -
edit: Have the syntax for blockquotes changed as of late?
Samuel Durkin
48,402 PointsHe sees the test fail, but he sees what he believes is the correct string in the alert box.
The sentence is a bit messy, but I think it's quite clear that's what he means.
Jacob Mishkin
23,118 PointsJacob Mishkin
23,118 PointsThe challenge ask you to alert the string "Welcome student", it is very peculiar as to what it wants.