日期:2014-05-16 浏览次数:20471 次
fun = function() {
var hello ;
eval('hello = {}');
}
fun()
alert(hello) ;
?调用fun()函数,变量hello是局部变量,报错:hello is not defined ;
fun = function() {
eval('hello = {}');
}
fun()
alert(hello) ;
?调用fun()函数,变量hello是全局变量,提示:[object Object]