1.关键字
break do instanceof typeof case else new var try catch finally return void
continue for switch while debugger function this with default if throw delete in
2.保留字
abstract enum int short boolean export import interface static byte extends
long super char final native class synchronized float package throws const
goto private transient implements protected volatile double public
3.转义字符
var a="hello world\"";
console.log(a);
代码 | 输出 |
---|---|
‘ | 单引号 |
“ | 双引号 |
& | 和号 |
\ | 反斜杠 |
\n | 换行符 |
\r | 回车符 |
\t | 制表符 |
\b | 退格符 |
\f | 换页符 |
4.常量
创建之后,不能修改
const = 3.14;