menu
ホーム > javascript > JavaScript 予約語

JavaScript 予約語

JavaScriptリファレンス
JavaScript 予約語 | wepicks!

予約語とは

予約語 は、JavaScript が使用するキーワードであり、これらのワードは特別な意味を持っています。そのため、プログラムの識別子(変数名、関数名、メソッド名、オブジェクト名など)として使用することが出来ないワードです。例えば、変数を new という識別子で作成したとします。new は予約語です。

実行すると、 SyntaxError: Unexpected token new という構文エラーが発生します。予約語 は 識別子 として使用できないとうことです。token(トークン)。

また、予約語 は小文字で記述します。JavaScript では 大文字 と 小文字 を区別します。

予約語の仕様

予約語は、ECMAScript(エクマスクリプト) の仕様で決められています。

予約語 ECMAScript 7 (2016)

ECMAScript 7(ECMA-262 7.0 Edition の11.6.2.1)(2016年版)

予約語

breakvoidswitch
doclassyield
inextendsdebugger
typeofreturnfunction
casewhilethis
elseconstdefault
instanceoffinallyif
varsuperthrow
catchwithdelete
exportcontinueimport
newfortry

将来的に言語拡張で使用される予約語

implementspackageprotected
interfaceprivatepublic

厳格モードで将来的に使用される予約語

enumawait

予約語 ECMAScript 6 (2015)

ECMAScript 6(ECMA-262 6.0 Edition の11.6.2.1)(2015年版)

予約語

breakexportsuper
caseextendsswitch
catchfinallythis
classforthrow
constfunctiontry
continueiftypeof
debuggerimportvar
defaultinvoid
deleteinstanceofwhile
donewwith
elsereturnyield

将来的に言語拡張で使用される予約語

implementspackageprotected
interfaceprivatepublic

厳格モードで将来的に使用される予約語

enumawait

予約語 ECMAScript 5.1 (2011)

ECMAScript 5(ECMA-262 5.1 Edition の7.6.1.1)(2011年版)

予約語

breakfinallythis
caseforthrow
catchfunctiontry
continueiftypeof
debuggerinvar
defaultinstanceofvoid
deletenewwhile
doreturnwith
elseswitch 

将来的に言語拡張で使用される予約語

classexportsuper
constextends
enumimport

厳格モードで将来的に使用される予約語

implementspackagepublic
interfaceprivatestatic
letprotectedyield

使用を避けた方が良い識別子

JavaScript のオブジェクト名、プロパティ名、メソッド名

JavaScript に組み込まれたオブジェクト名、プロパティ名、メソッド名の使用は避けましょう。

ArrayStringNumber
Infinityevalundefined
MathisNaNhasOwnProperty
prototypenamelength
DatetoStringObject
isFinitefunctionvalueOf
NaNisPrototypeOf 

JavaScript のグローバル変数やグローバル関数

以下のワードは、グローバル変数やグローバル関数として定義されている識別子です。以下の名前の識別子は避けるべきでしょう。

argumentsEvalErrorRangeError
ArrayInfinityReferenceError
BooleanisFiniteNumber
DateisNaNString
decodeURIMathSyntaxError
decodeURIComponentNaNTypeError
encodeURIFunctionundefined
ErrorObjectunescape
escapeparseFloatRegExpURIError
evalparseInt 

Windows の予約語

JavaScript は HTML 以外でも、多くのアプロケーションプログラムで使用することが可能です。Windows の予約語なども避ける方が無難です。

alertpasswordframe
assignradiolink
clearTimeoutsecureframes
constructorstatusimages
documenttopouterHeight
encodeURIanchorparent
focusbuttonplugin
innerWidthclosescreenX
mimeTypesdecodeURIself
hiddenelementstaint
openescapeuntaint
packagesformsarea
parseIntlayersclearInterval
propertyIsEnumnavigatorconfirm
scrollimagedefaultStatus
setTimeoutoptionembeds
textareapageYOffsetfileUpload
allpkcs11innerHeight
blurresetlocation
clientInformationselectframeRate
cryptosubmitoffscreenBuffering
elementunescapeouterWidth
encodeURIComponentanchorsparseFloat
formcheckboxprompt
layerclosedscreenY
navigatedecodeURIComponentsetInterval
historyembedtext
openereventwindow
pageXOffset 


タグ(=記事関連ワード)

日付

投稿日:2018年6月12日
最終更新日:2018年06月13日

このカテゴリの他のページ

この記事へのコメント

トラックバックurl

https://wepicks.net/jsref-reserved_word/trackback/

page top