Appearance
禁止使用var
var是老的用法了,有作用域提升的问题,容易出bug.
使用let或const替代var。
let
const
var
不变的常量用const,可以修改值的变量用let.
var foo = 'ranwawa';
const bar = {};