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 trialpakarang buacharoen
Full Stack JavaScript Techdegree Student 1,897 Pointstrying to study hard through the holiday, please help out with boolean task, can't seem to get it right.
```const isAdmin = true; const isStudent = false; let message= 'isAdmin';
if ('isAdmin' === true){ message=Welcome ad
const isAdmin = true;
const isStudent = false;
let message= 'isAdmin';
if ('isAdmin' === true){
message=Welcome admin;
}
1 Answer
jb30
44,806 Points'isAdmin' === true
compares the types and values of the string 'isAdmin'
and the boolean true
. Try removing the quotes around isAdmin
to compare the value of the variable isAdmin
to true
.
To set the value of message
to the string 'Welcome admin', put quotes around the string.
The challenge is not expecting the value of message
to be set outside the if
statement, so change the line let message= 'isAdmin';
to let message;