CH2_JS词法结构笔记

73 阅读1分钟

** 字符集
** 注释
** 直接量
** 标识符和保留字
** 可选的分号
1.JS 程序是用Unicode字符集编写的。

2.JS 是区分大小写的程序。

3.标识符 就是一个名字。

4.保留字:如

default,delete,instanceof,debugger,do ,while

5.ES3将Java所有的关键字都作为自己的保留字。

abstract,double,goto.native.enum,export,

import,private,synchronized,class,transient,volatile

6.JS 预定义了很多全局变量和函数,应当避免把它们的名字用做变量名和函数名。

arguments,encodeURI,Infinity,Number,RegExp;
Array,encodeURICompent,isFinite,Object,String;
Boolean,Error,isNaN,parseFloat,SyntaxError;
Date,eval,JSON,parseInt,TypeError;
decodeURI,EvalError,Math;RangeError;undefined;
decodeURIComponent,Function,NaN;ReferenceError;URIError;