1. 要将赋值表达式作为if, while等语句的条件时,要在前面加上"!!",表明是有意而为。以防日后误解其真正用途。 //php if(!!$var = true){ //... } //js var v; if(!!(v = true)){ //... }