티스토리 뷰

공부/JS

[JS] A standard IF statement

Carrot🥕 2020. 4. 24. 04:26

if ( ) {}  EXECUTE!!

1
-1
"true"
"false"
"1"
"0"
"-1"
[]
{}
[0]
[1]

 

 

if (  ) {}  DO NOT XECUTES!

false
0
""
null
undefined
NaN

 

 

 

출처 : https://dorey.github.io/JavaScript-Equality-Table/

댓글