保留字也称关键字,每种语言中都有该语言本身规定的一些关键字,这些关键字都是该语言的语法实现基础,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 |
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· DeepSeek 开源周回顾「GitHub 热点速览」
· 物流快递公司核心技术能力-地址解析分单基础技术分享
· .NET 10首个预览版发布:重大改进与新特性概览!
· AI与.NET技术实操系列(二):开始使用ML.NET
· 单线程的Redis速度为什么快?