现在的位置: 首页 > 综合 > 正文

js中 如何声明隐式全局作用域变量

2013年10月04日 ⁄ 综合 ⁄ 共 98字 ⁄ 字号 评论关闭

一个简单的例子让你明白

 

function test(){
    ck="hello"
}
alert(window.ck);//undifined 
test();
alert(window.ck);//hello

 

抱歉!评论已关闭.