1/33: Please Help!


#1

var answer = function() {
if ((answer === 270) || (answer === !false) || (answer === "BEX"))
return true;
}
else {
return false;
}
};


#2

Hi,

I will show my code below, all I did was set var answer to initially = false:

var answer = false; {

I then wrote the following if statement to check at least one condition is true:

if (3 * 90 === 20 || "bx".toUpperCase === "BEX" || !false && true) {
    
    answer = true;
}
else
{
    answer = false;
}

};

The variable 'answer' does not need to be a function, it just needs a boolean value, when this is the case the 'return' statement is not needed and should instead be updating the variable to the correct answer:

answer = true - if conditions met / else answer = false

if you play around with that code you will notice when all = false, the returned value is false. When 1 or more is true the returned value is true.

Took me a while to get this 1!