[JavaScript] If/else statement with no curly brackets

cho yunsu·2021년 8월 31일
0

You can drop curly braces for nearly all block-scoped structures (if, for, while, etc). The only exception (heh) I've ran into where this isn't the case is with try and catch.

If you don't include curly braces, only the first statement after the block will be executed.

profile
Growing Developer!!

0개의 댓글