本帖最后由 hckxzy 于 2011-02-18 15:12:43 编辑

解决方案 »

  1.   

    constructor 属性表示创建对象的函数stu.constructor,stu是个对象,是用Student函数创建的,故alert(stu.constructor)显示函数的完整内容: function Student(){
        
    }
      

  2.   

    请问Student.prototype.constructor和Student.constructor为什么不同,stu.constructor为什么和Student.constructor不同而和Student.prototype.constructor相同?
      

  3.   

    constructor字面意思就是创建者,故我理解Student.constructor,是Student这个函数的创建者,就是通过function Function(){[native code]}创建出来的,故这样显示之Student.prototype.constructo,Student.prototype是Student的一个属性,此属性由谁创建,肯定是由其主体Student创建出来的,故Student.prototype.constructo显示为Student函数的完整内容