I think it's a site error can someone tell me if I'm right (13/14)


#1

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

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

Like wtf


#2

You put:

That equals to the opposite of false, which is true. So,

var programming = true

Now, you said that if programming is false, return false. Else, do returning true. BUT, you assigned programming AGAIN as FALSE. SO:

if(programming = false){             <---'Programming' is now false, returning true. What you have to do is going to be shown below
return false;
}else{
return true;
}

if(programming === false){
return false;
}
else{
return true;
}

But this also returns true, because remember, you assign programming as true here:

That whole thing is pretty much the problem, for the problems are pretty much connected.:smiley:


#3

So I tried your code, and it gave me an error message saying "Oops, try again. Did you set programming to false?" How do I fix this?


#4

Well, if you have to set programming to false, you have to do
var programming = false

Because it says to put programming to false.:smiley:


#5

var programming = !true;

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

};

This is my code and it gave me the "Oops, try again. It looks like your happy function returns true instead of false when programming is true" error. How do I fix that?


#6

Huh. You know, even though it does equal false here:

Why don't you just try stating the variable programming as false? Like, with no !.


#7

Hey! I know where you made your mistakes ( if you still want some help ) !

var programming = !false    /* Do NOT type '!false' here! the var should state 'false'!*/
var happy = function() {
 if (programming = false) {   /*Here is ur most critical mistake. If you remember, you only use 1 '=' when you define a variable! (the if statement should say: if (programming === !false) { ! <----- REMEMBER! Everything else is perfect. */
 return false;
 } else {
 return true;
 }
};
happy();