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

JavaScript JavaScript Basics Making Decisions in Your Code with Conditional Statements Add a Final 'else' Clause

final else clause I have been trying to figure this challenge for two days now. Help.

if ( isAdmin)
message = 'Welcome admin'; } else if ( isStudent) { message = 'Welcome student'; } else { messag

script.js
const isAdmin = false;
const isStudent = true;
let message;

if ( isAdmin) {
  message = 'Welcome admin';
} else if ( isStudent) {
  message = 'Welcome student'; 
} else {
   message = 'Acces denied';
}

1 Answer

Cameron Childres
Cameron Childres
11,817 Points

Hi Alana,

Your code is looking good! You're just missing an 's' in 'Access'.

Once that typo is repaired be sure to change:
const isStudent = true;
back to:
const isStudent = false;
as supplied in the original code, or the test won't be able to check your answer correctly.