I recently looked at the JavaScript framework design and mentioned some "unthinkable situations" when explaining the type decision, but it was not stated exactly when the situation would occur. Play for yourself and write essays. But there may be other times when I find out about these weird phenomena. 2333
Question: When will it appear in JavaScript?
a !== a
a == b && b != a
a == !a
a == b && a == c && b != c
a != b && a != c && b == c
Answer
Refer to ECMA-262 Edition 5.1 section 11.9.6, actually! = is also true (refer to 11.9.3)
var a =// true
Only ie6~8 will appear (because window does not belong to the ECMAScript constraint range)
var a = window;var b == = = B && b! = a); // true
Refer to ECMA-262 Edition 5.1 section 11.9.3, which is also explained here
var a == = =!a); // true
- Javascript:the from Douglas Crockford good Parts, also refer to 11.9.3, here are explained
var A = 0; var b = "; var C = ' 0 ' ;console.log (a = = b && A = = C && b! = c); //
- The source is the same as the 4th way
var false ; var b = undefined; var NULL ! = B && A! = c && b = = c); // true
The Black magic in JavaScript is horrible, aha, haha ... Although it is a little bit of a thing, but the actual development may really be in the case of the pit. So, in most cases, still can use = = = = = = Good ...
Javascript:the Evil Parts-1