为什么alert(undefined)?
当然是undefined 了,注意 SubType 的对象的sayAge 方法是没有参数的,所以你传这两个参数没有任何意义改成这样。var ol=new SubType("你好",18);ol.sayAge();