Wrong else Command


#1



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


SyntaxError: expected expression, got keyword 'else'
I dont get what is wrong with the "else"


var programming = false

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


#2

Something is fishy here...


#3

Okay Changed thanks a lot.
No i get this very confusing error Message:

var programming = false

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

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


#4

what @amanuel2 was trying to say about this being fishy:

if(programming = false)

is that you use a single equal sign, which means assign a value. It is common practice to compare (using two equal signs). Either way, !false is true, so your program will always return true. It should also return false if the conditions are right


#5

Oh Okay thanks a lot for that i get this wrong quite regular. hopefully this time i will learn