js学习笔记一-语法结构

js是区分大小写的,关键字、变量、函数名和所有的标识符都必须采取统一一致的大小写形式。

js定义了unicode转义序列,以u开头,其后跟随四个十六进制数,可以在字符串直接量、正则表达式直接量和标识符中(关键字除外)使用

js的单行注释是//格式,后面的语句是注释内容

多行注释是 /* 注释内容 */

js标识符必须是以字母、_、$开始,js也允许非英语语言和数学符号来做为标识符,但是不建议这样做,最好还是ASCII码比较好

尽量每行都加上分号以免出错

js的保留字如下,请不要使用如下字符作为标识符

A arguments abstract Array
B break boolean byte Boolean
C case catch continue class const char
D debugger default delete do double Date decodeURI decodeURIComponent
E else enum export extends eval encodeURI encodeURLComponent Error evalError 
F false finally for function final float Function
G goto
H  
I if in instanceof import implements interface int Infinity isFinite isNaN 
J JSON
K  
L let long
M Math
N new null native NaN Number 
O Object
P private public package protected parseFloat parseInt 
Q  
R return RangeError ReferenceError RegExp
S switch super static short synchronized String SyntaxError
T this throw true try typeof transient TypeError
U undefined URIError
V var void volatile
W while
X  
Y yield
Z  

  

原文地址:https://www.cnblogs.com/iuyes/p/3495884.html