본문 바로가기

학습 내용 정리/javascript

javascript 변수의 네이밍 컨벤션

728x90

1. 하이픈 (-) 사용 금지

 

2. 첫 글자 숫자 금지

 

3. 예약어 사용 금지

abstract arguments boolean
break byte case
catch char class
const continue debugger
default delete do
double else enum
eval export extends
FALSE final fianlly
float for function
goto if implements
import in instanceof
int interface let
long native new
null package private
protected public return
short static super
switch synchronized tis
throw throws transient
TRUE try typeof
var void volatile
while with yield

 

4. boolean type 변수명 작성법

참고자료 : https://soojin.ro/blog/naming-boolean-variables

  • is 용법
    • is + 명사
    • is + 현재진행(~ing)
    • is + 형용사
    • is + 동사원형 (절대 쓰면 안됨)
  • 조동사 용법
    • can, should, will 등
    • 조동사 + 동사원형
  • has 용법
    • has + 명사
    • has + 과거분사 (is + 과거분사와 의미 거의 동일)
  • 동사원형 용법
    • 3인칭 단수

'학습 내용 정리 > javascript' 카테고리의 다른 글

javascript 자료구조 Set  (0) 2023.08.03
javascript 자료구조 Map  (0) 2023.08.03
javascript Array method  (0) 2023.08.02
javascirpt Math method  (0) 2023.08.02
변수와 상수  (0) 2023.07.26