javascript的prototype继承问题

代码:

<script type="text/javascript">
        function classAA() {
            this.a = function () { alert(); };
        }
        function classBB() {
            this.b = function () { alert(); };
        }
        classBB.propertyIsEnumerable = new classAA();
        var objB1 = new classBB();
        var objB2 = new classBB();
        alert(objB1.a == objB2.a);
        alert(objB1.b == objB2.b);
    </script>

结果:alert(objB1.a == objB2.a);得到的结果是true

         alert(objB1.b == objB2.b);得到的结果是false

问题:为什么是这样的结果?请教其中的原理!!!

posted @ 2012-12-14 18:18  风中娉婷  阅读(148)  评论(0编辑  收藏  举报