const
实际上是保证其声明的变量在栈中的值不可改变
// 基本数据类型
const str = 'hello';
str = 'hello world'; // VM297:1 Uncaught TypeError: Assignment to constant variable.
// 引用数据类型
const o = {
'str': 'hello'
}
o = {
'str': 'hello world'} // VM297:1 Uncaught TypeError: Assignment to constant variable.
o['str'] = 'hello world'; // {'str': 'hello world'}