Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

JavaScript JavaScript Basics Making Decisions in Your Code with Conditional Statements Boolean Values

Max van den Berge
Max van den Berge
1,911 Points

Hello, i have a question . is it common to have a second conditional statement? altought i m a beginner to JS. i never s

Hello, i have a question . is it common to have a second conditional statement? altought i m a beginner to JS. i never saw this. can anyone give me some info on this?

Steven Parker
Steven Parker
210,475 Points

It's not clear what you are asking about. Perhaps you could show the code, or give a time reference in the video where the "second conditional statement" can be seen.

3 Answers

Max van den Berge
Max van den Berge
1,911 Points

your are right :) thanks for the replay:

Hello, i have a question . is it common to have a second conditional statement? altought i m a beginner to JS. i never saw this. can anyone give me some info on this? i saw it the first time during this video

let correctGuess = false; const number = 6 ; const guess =prompt("guess a number between 1-10");

if (+guess === number) {

correctGuess = true;

} if ( correctGuess=== true) { console.log('The condition is false.'); }

else { console.log(Sorry. the number was ${number}); }

Steven Parker
Steven Parker
210,475 Points

I agree that seems a bit odd, you wouldn't do this in actual practice.

But I think this was done just to illustrate the use of Boolean values.

Max van den Berge
Max van den Berge
1,911 Points

all right , thanks for the answer Steven: )

Steven Parker
Steven Parker
210,475 Points

Max van den Berge — Glad to help. You can mark a question solved by choosing a "best answer".
And happy coding!