Lesson 13 - "Not"


#1

Oops, try again. It looks like your happy function returns false instead of false when programming is false.

So, I've looked at some tips on this lesson and put it in, specifically the 'programming = !false' however, I'm just stumped. Looks good to me. Any help would be appreciated! My code:

var programming = false;

var happy = function() {
  // Add your if/else statement here!
  if(programming = !false) {
     return false;
  }
  else {
   return true;}
};

#2

Hi this line

if(programming = !false)

try to change the = with ===


#3

Hey Seth, when you give advice like this, it helps the new learner if you include the reason why.


#4

Hi Judy sorry sometime :worried: I forgot..

@nicky_sitnikovs

So when you use one = its for storing value inside variable like that

var myName = "Wizmarco";

And when you use == or === they are comparators

12 === 2 * 6  --- this will be true
50 == 2 * 15  --- this will be false
6 * 3 === 9   --- this will be false
500 == 250 * 2 --- this will be true

and you can find more about the diff between == and ===