- 参考阮一峰的JavaScript教学
- 对上一篇博文的补充
JavaScript历史

ECMAscript是JavaScript标准
ES 5 新增特性汇总-方应航知乎专栏(15个小变化)
ES 6 新增特性汇总-方应航知乎专栏
以后一年一次
ES 7(2016)只增加了两个特性,ES 8(2017)只增加了10个特性
ES5-->ES6功能最多
数据类型补充
number string symbol boolean null undefined object

number

string

多行字符串

ES6新特性,多行字符串可以用`反引号,需要注意的是,空格和回车都算字符串里的一个字符


null和undefined

区别:

对象

in 只查看key是否存在



for in循环注意点
for(var key in person){
console.log(person.key)
}
注意:person.key = person['key']
要用
person[key]

for... in可能会随机遍历,不按照声明顺序

typeof BUG

网友评论