Ihave not i dea


#1

(((3 * 90) === 270) || !(false && (!false)) || "bex".toUpperCase() === "BEX");
@albionsrefuge


#2

Those things look crazy :smile:

The first thing to do is work out the stuff in the brackets.


#3

Are you debugging this? You could split it up and store partial results in variable names to make it more manageable, easier to reason about.

No clue what it's about though


#4

i have no idea on how to do it


#5

What is it that you want to do?


#6

Declare a variable named answer. Assign to it the Boolean value that the expression evaluates to. Delete the default code in the editor and run your code.


#7

Then as @albionsrefuge suggested, pick out parts of the expression and replace it with what it evaluates to. Start with the innermost brackets.

So we could start with 3 * 90, that's 270, and now we've got

((270 === 270) || !(false && (!false)) || "bex".toUpperCase() === "BEX");

#8

(((270) === 270) || !(false && (!false)) || "bex".toUpperCase() === "BEX");
var answer

Neww Code
Now it says
You seem to have gotten the wrong answer. Check the hint for some help!


#9

It's still not a single value! Keep replacing things until only true/false remains


#10

i stilll dont understand can you explain to me?


#11

Now you've got (270 === 270). What does that evaluate to?


#12

idk im still new to this


#13

See this for descriptions of what === and other operators do:
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Expressions_and_Operators#Comparison_operators

That link leads straight to ===, but if you want to look up another operator, you can use your browsers built in search feature (ctrl+f)


#14

(((270) != 270) || !(false && (!false)) || "bex".toLowerCase() != "BEX");
var answer

New Code and it still says that im wrong


#15

The goal of this exercise it to end up with one of these:

var answer = true;

or

var answer = false;

To figure out if it should be true or false, you have to work you way through reducing that long expression down to one word.

I will do one step for you:

(((3 * 90) === 270) || !(false && (!false)) || "bex".toUpperCase() === "BEX")
(((3 * 90) === 270) || !(false && (!false)) || true)

Now you should pick one more piece of that expression and convert it.


#16

@albionsrefuge
(((2 * 90) === 270) || !(true && (!false)) || "BEX".toUpperCase() === "bex");
var answer = false;

Now it is saying You seem to have gotten the wrong answer. Check the hint for some help!
Answer is false


#17

If you would like to step us through your process for evaluating that expression and show us how you got to false then we can help you spot the problem.


#18

ok, i will go through what i did


#19

First I made the 3 * 90 = 270 to 2 * 90 = 270, then i changed !(false && !false)) to !(true && !false)) and lastly i changed "bex".toUpperCase() === "BEX" to "BEX".toUpperCase() === "bex"


#20

For that part, this is how I would work it out:

((3 * 90) === 270)
( 270 === 270 )
true

So now you have just true left before the first ||

true || !(false && (!false)) || "bex".toUpperCase() === "BEX")

See how that works? Reduce each section down to just true or false.