The special usage of "| |", "&&" in Javscript can make the code simple and Beautiful in the right place.
-----------------------------------------------------
A = 6;
a>=5 && alert (' OK ');
------------------------------------------------------
A = 6;
Alert (a >= 5 && "yes") | | (A < 5 && "no");
----------------------------------------------
Judging from left to right, encounter false returns, if not encountered, returns the last
var a = true && && 45;
alert (a);
var a = True && 0 && ' aaa ';
alert (a);
var a = && && ' aaa ' && true && 0 && 10;
alert (a);
-----------------------------------------------------------
From left to right, look for the first return to true, and return the last one without encountering it.
A = 12 | | False | | 13;
alert (a);
---------------------------------------------------------------
var a = 10;
var b = {' 5 ': 1, ' Ten ': 2, ' ': 3, ': 4}[a] | | 0;
Alert (b)
---------------------------------------------------------
Special usage of "| |", "&&" in JavaScript