operator can be understood from three different levels.

x &&y====0 0//only if x and y is 0, only returns true

null &&true//=>Null: values of the left operand is false, and to return it, the entire expression is false
true &&(5-3)//=>2: the left operand is true, calculate the right operand, and returns the results

var o={x: 1};
var p=null;
o &&o.x;//=>1 o is true value, return the value of o.x
p &&p.y;//=>Null: p is false, returns it, instead of calculating p.y

if (a==b) stop ();
(a==b) &&stop ();//with the above statement is equivalent

//check whether a true value, if it is, returned a, otherwise and a treatment with same b
//return to b if b is true, otherwise return 5
var Max=| a | b | | 5;

the function copy (o, p) {
p=p | | {};//if there is no to the parameter p transfer object, use the newly created object

operator precedence

the same priority operator, operation sequence determined by the combination of direction.

to remember is that simple! >Arithmetic operators >Relational operators >&&>| | >The assignment operator


This concludes the body part