//全局变量的声明
text = "全局变量";
function bl() {
text1 = "我也是全局变量";
var text2 = "我是局部变量";
console.log(text2);
}
bl()
console.log(text);
console.log(text1);
//局部变量的声明
function b2() {
text1 = "我也是全局变量";
var text2 = "我是局部变量";
console.log(text2);
}
b2()