console.log(typeof name) var name = 'world'
此时输出的是String
var name = 'world' (function () { if(typeof name === 'undefined') { var name = 'hello' } })()
为什么此时的typeof name就是undefined,可以进入函数里面,搞不懂
上面也是字符串的undefined啊