var loverName = 'zy'; console.log(loverName); var sex = 1,age=19; console.log(sex, age); var school=room='FZU'; console.log(school,room) console.log(typeof school) school = [1,2,3] console.log(typeof school) school = {name:'zy'} console.log(typeof school) /*** * * 变量提升:JS代码在执行之前,会把var声明的变量提升到各自作用域的最顶部 * 函数提升:JS代码在执行之前,会把function声明的函数提升到各自作用域的最顶部 * */ function loverZy(){ if(false){ var name = 'zy' } console.log(name) } loverZy()