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 trialxczurymqdj
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,704 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";
}
xczurymqdj
2,289 PointsThank you guys so much.
jacknoren
24,134 Pointsno problem !
jacknoren
24,134 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";
}