重学js1

发布时间 2023-07-17 11:30:03作者: 月下云生

一.命名

1.尽量字母开头字母结尾

2.构造函数以大写字母开头,避免方法(少用构造函数)

3.名字中不允许存在空格,原因在于早期编译器的内存管理,后期未修改规则

4.保留字

  arguments await break case catch class const continue debugger default delete do else
  enum eval export extends false finally for function if implements import in Infinity
  instanceof interface let NaN new null package private protected public return static
  super switch this throw true try typeof undefined var void while with yield
二.数值