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 trialcarl simpson
Courses Plus Student 15,941 Pointsadding booleans
Hi what gives with this question.. i have tried a few varieties but nothing seems to pass..
var condition = false;
if( 2 > 1) {
condition = true;
}
if ( condition === true ) {
alert('This is true');
} else {
alert('This is false');
}
2 Answers
Alex Heil
53,547 Pointshey carl, I just re-did this challenge to checkout your prob and your code is probably way too advanced for it ;)
in fact all the code is already there in the if-else conditional and you only have to insert one word, the boolean value (true or false), into the if-statement.
at the end the full solution should look like this:
if (true ) {
alert('This is true');
} else {
alert('This is false');
}
hope that helps and have a nice day ;)
carl simpson
Courses Plus Student 15,941 Pointsah .. thanks for that alex , i had set it originally as if(true === true){};
over complicating things in my head as usual ;)