JavaScript Tutorial.64

ansunny1170·2022년 1월 12일
0
post-thumbnail

JS Reserved Words

JavaScript에서는 아래 표의 예약어를 변수, 레이블 또는 함수 이름으로 사용할 수 없다.

abstractargumentsawait*boolean
breakbytecasecatch
charclass*constcontinue
debuggerdefaultdeletedo
doubleelseenum*eval
export*extends*falsefinal
finallyfloatforfunction
gotoifimplementsimport*
ininstanceofintinterface
let*longnativenew
nullpackageprivateprotected
publicreturnshortstatic
super*switchsynchronizedthis
throwthrowstransienttrue
trytypeofvarvoid
volatilewhilewithyield

*로 표시된 단어는 ECMAScript 5 및 6에서 새로 추가된 단어이다.

다양한 JavaScript 버전에 대한 자세한 내용은 JS Versions 장에서 읽을 수 있다.

Removed Reserved Words

다음 예약어는 ECMAScript 5/6 표준에서 제거되었다.

abstractbooleanbytechar
doublefinalfloatgoto
intlongnativeshort
synchronizedthrowstransientvolatile

삭제 되었다고는 하나 위 단어들을 변수로 사용하면 안된다. ECMAScript 5/6은 모든 브라우저에서 완전히 지원되지 않는다.

JavaScript Objects, Properties, and Methods

또한 JavaScript 내장 객체, 속성 및 메서드의 이름을 사용하지 않아야 한다.

ArrayDateevalfunction
hasOwnPropertyInfinityisFiniteisNaN
isPrototypeOflengthMathNaN
nameNumberObjectprototype
StringtoStringundefinedvalueOf

Java Reserved Words

JavaScript는 종종 Java와 함께 사용된다. 일부 Java 객체 및 속성을 JavaScript 식별자로 사용하는 것을 피해야 한다.

getClassjavaJavaArrayjavaClass
JavaObjectJavaPackage

Other Reserved Words

JavaScript는 많은 응용 프로그램에서 프로그래밍 언어로 사용할 수 있다.

하여 HTML 및 Window 개체 및 속성의 이름을 사용하지 않아야 한다.

alertallanchoranchors
areaassignblurbutton
checkboxclearIntervalclearTimeoutclientInformation
closeclosedconfirmconstructor
cryptodecodeURIdecodeURIComponentdefaultStatus
documentelementelementsembed
embedsencodeURIencodeURIComponentescape
eventfileUploadfocusform
formsframeinnerHeightinnerWidth
layerlayerslinklocation
mimeTypesnavigatenavigatorframes
frameRatehiddenhistoryimage
imagesoffscreenBufferingopenopener
optionouterHeightouterWidthpackages
pageXOffsetpageYOffsetparentparseFloat
parseIntpasswordpkcs11plugin
promptpropertyIsEnumradioreset
screenXscreenYscrollsecure
selectselfsetIntervalsetTimeout
statussubmittainttext
textareatopunescapeuntaint
window

HTML Event Handlers

또한 모든 HTML 이벤트 핸들러의 이름을 사용하지 않아야 한다.

Example:

onbluronclickonerroronfocus
onkeydownonkeypressonkeyuponmouseover
onloadonmouseuponmousedownonsubmit
profile
공정 설비 개발/연구원에서 웹 서비스 개발자로 경력 이전하였습니다. Node.js 백엔드 기반 풀스택 개발자를 목표로 하고 있습니다.

0개의 댓글