NOT Operator


#1

Im not understanding why its giving such a syntax error.


LINK:
https://www.codecademy.com/en/courses/javascript-beginner-en-qDwp0/2/4?curriculum_id=506324b3a7dffd00020bf661#

ERROR : SyntaxError: missing before statement


var programming = false


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

happy():


#2

HI this line

happy():

you have the : at the end

:


#3

Thankyou for the reply.

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


#4

you should return true so this line

return !true; //false

remove the ! to true


#5

Thanks that helped!
:blush:


#6

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