保留字也称关键字,每种语言中都有该语言本身规定的一些关键字,这些关键字都是该语言的语法实现基础,JavaScript中规定了一些标识符作为现行版本的关键字或者将来版本中可能会用到的关键字,所以当我们定义标识符时就不能使用这些关键字了,下面介绍下JavaScript保留字和预定义的全局变量及函数汇总

JavaScript保留字和预定义的全局变量及函数汇总_全局变量

一、官方保留字

if

else

break

delete

true

switch

case

catch

new

false

for

in

continue

null

function

do

while

finally

return

instanceof

try

with

throw

this

typeof

var

void

debugger

default

二、ES5保留字

let

yield

arguments

static

import

const

interface

implements

public

export

class

eval

package

private

protected

super

enum

三、JavaScript预定义的全局变量和函数关键字

Arguments

Array

Error

Infinity

parseFloat

encodeURI

Boolean

EvalError

isFinite

parseInt

encodeURIComponent

Date

RangeError

isNaN

RegExp

decodeURI

Function

ReferenceError

NaN

String

decodeURIComponent

Number

TypeError

JSON

Math

eval

Object

URIError

SyntaxError

undefined