About JavaScript in 0, the empty string, '0' is a summary of true or false

Asked about the recent js hollow string is true or false questions was, for a time I thought up, and now the output code to test the console panel in chrome look.

 

"" == false result is equal to true and false in js hollow string equal to empty string 0

0 == false when the comparison result is tue converted into Boolean type number is 0 true false 1

"0" == fase result is true number string Associate 

Boolean ( "0") The result is true Boolean strings turn into an empty string is non-empty string is true false

 

Guess you like

Origin www.cnblogs.com/yang-xiansen/p/11525506.html