《JavaScript at Scale》京东已到货!
Tag: javascript
Mindmap of 《Understanding ECMAScript6》
某个版本Chrome中的undefined
昨天百度新闻的同事让我帮忙排查一下线上问题,最终问题定位到这样一段代码:
if (window.varname === undefined) {
...
}
左侧是Chrome,右侧是Firefox
所以不要写这样的代码
if (window.xxxxxx === undefined) {...}
要写成
if (typeof window.xxxxx === "undefined" ) {....}
JavaScript中RegExp对象的类型
你知道typeof /a/
返回什么么?
Continue reading “JavaScript中RegExp对象的类型”