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 trialmalcolm mowlam
3,856 Pointschallenge task 1 of 1 conditional statements
can any one please give me a hint
const isAdmin = true;
const isStudent = false;
If (is admin){
let message= "Welcome admin";
}
2 Answers
Daniel Jong
11,071 PointsHi, replay the video to see how Guil did it. 'if' is a syntax, you can't just change the i to uppercase and spread the camel cased isAdmin to is admin.
Here's my solution for this challenge:
const isAdmin = true;
const isStudent = false;
let message;
if (isAdmin){
message= "Welcome admin";
}
Hope it helps!
Justin Stewart
1,298 PointsI know this is an older post but I was hoping this may help someone out. Actually took me a bit to figure this answer out. I had the correct "if" statement but they also want you to add the "else" statement.
const isAdmin = true;
const isStudent = false;
let message;
if (isAdmin) {
message = "Welcome admin";
}else {
isAdmin = isStudent;
}
Marcin Lipski
9,947 PointsMarcin Lipski
9,947 PointsHello Malcolm "if" should be non capitalized and "isAdmin" in brackets should be a one word with capital "A".
I hope this helps