<script type="text/javascript">
<!--
function test(){
this.a = 1;
alert(this);
}
test();
var t = new test();
alert(a);
//-->
</script>
问alert出来的内容分别是什么!
其实非常讨厌这一类的题目
本文深入探讨了一个简单的JavaScript函数的执行过程,包括其内部作用域、变量引用和全局作用域的影响,通过实例展示了如何使用JavaScript创建并调用函数,以及函数内部变量的作用方式。
<script type="text/javascript">
<!--
function test(){
this.a = 1;
alert(this);
}
test();
var t = new test();
alert(a);
//-->
</script>
问alert出来的内容分别是什么!
其实非常讨厌这一类的题目

被折叠的 条评论
为什么被折叠?