자바스크립트 예약어
JavaScript에서는 다음 예약어를 변수, 레이블 또는 함수 이름으로 사용할 수 없습니다.
abstract |
arguments |
await* |
boolean |
break |
byte |
case |
catch |
char |
class* |
const |
continue |
debugger |
default |
delete |
do |
double |
else |
enum* |
eval |
export* |
extends* |
false |
final |
finally |
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 |
this |
throw |
throws |
transient |
true |
try |
typeof |
var |
void |
volatile |
while |
with |
yield |
*로 표시된 단어는 ECMAScript 5 및 6에서 새로 추가된 단어입니다.
다양한 JavaScript 버전에 대한 자세한 내용은
JS 버전 장에서 읽을 수 있습니다 .
제거된 예약어
다음 예약어는 ECMAScript 5/6 표준에서 제거되었습니다.
abstract |
boolean |
byte |
char |
double |
final |
float |
goto |
int |
long |
native |
short |
synchronized |
throws |
transient |
volatile |
이 단어를 변수로 사용하지 마십시오. ECMAScript 5/6은 모든 브라우저에서 완전히 지원되지 않습니다.
JavaScript 개체, 속성 및 메서드
또한 JavaScript 내장 객체, 속성 및 메서드의 이름을 사용하지 않아야 합니다.
Array |
Date |
eval |
function |
hasOwnProperty |
Infinity |
isFinite |
isNaN |
isPrototypeOf |
length |
Math |
NaN |
name |
Number |
Object |
prototype |
String |
toString |
undefined |
valueOf |
자바 예약어
JavaScript는 종종 Java와 함께 사용됩니다. 일부 Java 객체 및 속성을 JavaScript 식별자로 사용하는 것을 피해야 합니다.
getClass |
java |
JavaArray |
javaClass |
JavaObject |
JavaPackage |
|
|
기타 예약어
JavaScript는 많은 응용 프로그램에서 프로그래밍 언어로 사용할 수 있습니다.
또한 HTML 및 Window 개체 및 속성의 이름을 사용하지 않아야 합니다.
alert |
all |
anchor |
anchors |
area |
assign |
blur |
button |
checkbox |
clearInterval |
clearTimeout |
clientInformation |
close |
closed |
confirm |
constructor |
crypto |
decodeURI |
decodeURIComponent |
defaultStatus |
document |
element |
elements |
embed |
embeds |
encodeURI |
encodeURIComponent |
escape |
event |
fileUpload |
focus |
form |
forms |
frame |
innerHeight |
innerWidth |
layer |
layers |
link |
location |
mimeTypes |
navigate |
navigator |
frames |
frameRate |
hidden |
history |
image |
images |
offscreenBuffering |
open |
opener |
option |
outerHeight |
outerWidth |
packages |
pageXOffset |
pageYOffset |
parent |
parseFloat |
parseInt |
password |
pkcs11 |
plugin |
prompt |
propertyIsEnum |
radio |
reset |
screenX |
screenY |
scroll |
secure |
select |
self |
setInterval |
setTimeout |
status |
submit |
taint |
text |
textarea |
top |
unescape |
untaint |
window |
|
|
|
HTML 이벤트 핸들러
또한 모든 HTML 이벤트 핸들러의 이름을 사용하지 않아야 합니다.
예:
onblur |
onclick |
onerror |
onfocus |
onkeydown |
onkeypress |
onkeyup |
onmouseover |
onload |
onmouseup |
onmousedown |
onsubmit |