將函數(shù)的繼承封裝成如下函數(shù):function extend(child, parent){ var f = function(){}
f.prototype = parent.prototype
child.prototype = new f()
child.prototype.constructor = child
child.uber = parent.prototype}
function Creature(){}
function Person(){}extend(Person, Creature)請教一下,這是訪問Person.uber屬性,為什么是undefined?
請教一下這個JavaScript的繼承問題
四季花海
2018-10-19 14:10:25