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)
![monique champagne](https://uploads.teamtreehouse.com/production/profile-photos/11707230/micro_IMG_1160.jpg)
monique champagne
761 Pointsnot sure why my answer is wrong-
cant figure out what im doing wrong here..
const isAdmin = true;
const isStudent = false;
let message = "Welcome admin";
if ( isAdmin ) {
console.log(message);
}
3 Answers
![Heidi Fryzell](https://uploads.teamtreehouse.com/production/profile-photos/10752501/micro_new-headshot.jpg)
Heidi Fryzell
Front End Web Development Treehouse Moderator 25,178 PointsHi Monique,
The instructions say if the isAdmin variable is true, set the value of the message variable to "Welcome admin".
So inside the if statement is where you are going to set the value of the variable.
In your code you set the value of the variable message outside the if statement and you console logged the message inside the if statement.
You don't need to console log the message in this challenge.
const isAdmin = true;
const isStudent = false;
let message;
if (isAdmin){
//assign variable here, you already declared it above with "let"
}
I hope this helps and happy coding!
![monique champagne](https://uploads.teamtreehouse.com/production/profile-photos/11707230/micro_IMG_1160.jpg)
monique champagne
761 PointsAhh! Thank you!
![monique champagne](https://uploads.teamtreehouse.com/production/profile-photos/11707230/micro_IMG_1160.jpg)
monique champagne
761 Pointsoh ok- i think i get it... would this be better?
const isAdmin = true;
const isStudent = false;
let message;
if ( isAdmin ) {
message = "Welcome Admin!";
}
is the let message ok to just leave like it is? i would have thought it would be something like let message = " "; so it had some kind of blank to fill in... thanks so much for your help!
![Heidi Fryzell](https://uploads.teamtreehouse.com/production/profile-photos/10752501/micro_new-headshot.jpg)
Heidi Fryzell
Front End Web Development Treehouse Moderator 25,178 PointsYes, that would work, except one little thing. You have to match exactly what they ask for in the instructions.
So for the welcome admin message you can't add punctuation or capitalization. It has to be exactly how they did in the instructions
message = "Welcome admin";