17. Why does this not work :(


#1

if (10 === 10) {
console.log("You got it true!");
} else {
console.log("You got it false!");
}
i keep seeing an error!
Any Suggestions???


#2

Remember from the instructions, "computers are very literal".

Check carefully what your error message is saying:

It looks like your if/else didn't log 'You got a true!' to the console.


#3

But then this doesn't work either.

if (10>2) {
console.log('You got a true!');
}
else {
console.log('You got a false!');
}


#4

There are only two changes to make in the provided code.

  1. Change = to ===
  2. Remove the semi-colon from if (10 = 10); {

                                     ^

#5

Thanks, You are right. Also if using chrome, I found out that the correct answer does not work in Chrome. I tried firefox and it worked.