Welcome to the Treehouse Community
The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

pinky
2,289 PointsIm not sure where im going wrong please can someone help me
so im not sure what im doing wrong in my code. some insight would be nice.
const isAdmin = false;
const isStudent = true;
let message;
if ( isAdmin ) {
message = 'Welcome admin';
}
else if (isStudent)
message = "Welcome student";
}
4 Answers

Phil Wright
3,654 PointsHi Pinky
You’ve got this, it is just missing an opening brace '{' after (isStudent) to balance everything.
const isAdmin = false;
const isStudent = true;
let message;
if (isAdmin ) {
message = 'Welcome admin';
} else if (isStudent) {
message = "Welcome student";
}

Adrian Ralston
6,830 PointsIt seems very solid but notice you overlooked one curly bracket in the second half of your code
else if (isStudent)
message = "Welcome student";
}

pinky
2,289 PointsThank you guys so much.

jacknoren
24,120 Pointsno problem !

jacknoren
24,120 PointsHey pinky! Looks like you almost had it ! I see a few people giving you the answer already but for the future just make sure you create {} marks first and just type within both of them. That way you have a much harder time forgetting them. Best of luck ! Here is the solution.
const isAdmin = false;
const isStudent = true;
let message;
if ( isAdmin ) {
message = 'Welcome admin';
}
else if (isStudent) {
message = "Welcome student";
}