## 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.

# In the If at the end.Why do we not add correctGuess= true.?

In the If statement in the end why do we not do it like this: if (correctGuess= true) { document.write("<h1> You Guessed the number right.</h1>"); document.write("It took you " + guessCount + " tries to guess the correct number " + randomNumber + "."); } else if (correctGuess= false){ document.write("<h1> Sorry. You did not guess the number.</h1>") }

Check your code and check IF statment

```=   is for Asign value to
Example :
var a = 2;

== is for equal check :)

var a == 2      -> this return true or false
```

so you cant do this

``` if (correctGuess= true)
```

Here is another way of doing it:

EDIT: if you just need to check if a variable is true or truthy, then you don't really need to say == true, == false etc..

```if (correctGuess) { // same as saying "correctGuess == true"
// do something
} else if (!correctGuess) { // same as saying "correctGuess != true"
// do something
} else {
// do something
}
```

Explain your code as someone who is new would have no idea :)

:D Perfect now he knows what the abbreviations mean :D