블록(Blocks)
Use braces with all multi-line blocks.
복수행의 블록에는 중괄호 ({}) 를 사용해 주십시오.
// bad if (test) return false; // good if (test) return false; // good if (test) { return false; } // bad function() { return false; } // good function() { return false; }
If you're using multi-line blocks with
if
andelse
, putelse
on the same line as yourif
block's closing brace.복수행 블록의
if
와else
를 이용하는 경우else
는if
블록 끝의 중괄호(})와 같은 행에 위치시켜 주십시오.// bad if (test) { thing1(); thing2(); } else { thing3(); } // good if (test) { thing1(); thing2(); } else { thing3(); }
'개발 > Javascript' 카테고리의 다른 글
공백(Whitespace) (0) | 2018.03.11 |
---|---|
코멘트(Comments) (0) | 2018.03.11 |
프로퍼티(Properties) (0) | 2018.03.11 |
Arrow함수(Arrow Functions) (0) | 2018.03.11 |
조건식과 등가식(Comparison Operators & Equality) (0) | 2018.03.11 |