摘要:
看到下面这段代码能知道他的输出吗<script type="text/javascript">function C (){ this.x = 10; this.y = 10;}C.prototype.pi = 3.14;C.prototype.area = function(){ alert(this.x * this.y * this.pi);}var B = new C();B.pi = 314;alert(B.pi);alert(C.prototype.pi);</script>没错 第一次输出 是 314,第二次是 3.14通过B.pi = 阅读全文