Javascript boolean tricky question, Either You can explain why? or welcome to the confusion club.
I don't know if it defines as a tricky but I asked few guys and they all had no idea why it is happening. here is the basic noob code. var name = ""; var status = ""; var m = "asd"; console.log(Boolean(name)); // or status, both are false coz both empty string console.log(Boolean(m)); // this is true coz a filled string. console.log((name == status) == m); // So the way js works, as JS being asynchronous. it should be like this. console.log((true) == m) according to grouping operator, first they will be checked, and then now it's (true == m) and if you check what is m in boolean, u can see it's true by Boolean(m) func. so it should be (true == true) which should return the true value. But it is returning false HOW? (name == status); // returns true. coz both are false. // avoiding === so it doesn't make it more confusing ps: I found this while practising with booleans and didn't get an explanation yet.