Albeit instruction is not followed,the code is still correct


Although below code is correct but i have a confusion with instructions,the instruction is to return true if programming was false and false for other way around,but isn't !programming=true? so what actually happened is,it returned true for !programming being true. :confused:

var programming=false;

var happy = function() {
return true;
return false;


Hi It use The ! To change The value of prgramming To true

!true  --> false 
!false  ---> true 

#your variable 
var programming  = false;
console.log (!programming);


So in this case


The if statement is true and return true


return !programming;   # true

It is that simple, and the author wanted to drive that point home. This lesson has all the hallmarks of confusion central. If you don't get this, then don't continue. You don't get it.


thank you i got the notion of it now.


This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.