NOT Operator


Im not understanding why its giving such a syntax error.


ERROR : SyntaxError: missing before statement

var programming = false

var happy = function() {
  if(!programming) //true
         return !true; //false
          return false;



HI this line


you have the : at the end



Thankyou for the reply.

I found that typing mistake,corrected it but still getting the same error.


you should return true so this line

return !true; //false

remove the ! to true


Thanks that helped!


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