JavaScript的this关键字

<script> function Person(a, b, c) { this.a = a; this.b = b; this.c = c; } var p = Person(1,2,3); alert(this.a); // alert(a); </script> 这个时候的Person()调用只是给js的window对象的增长了3个属性a,b,c。javascript
相关文章
相关标签/搜索