以下是題目,需要補充代碼。自認不才,特來求助各位大神,望指點迷津.題目是讓補全 A 的代碼,讓這個代碼可以跑起來,輸出對應的結果var A = function () { this.name = 'apple';}A.prototype.getName = function () { return this.name;}//補充代碼var B = A.extend({ initialize: function () { this.superclass.initialize.call(this); this.total = 3; }, say: function () { return '我有' + this.total + '個' + this.getName() }}); var b = new B(); console.log(b.say());//我有3個apple;
今天面試碰到JS題,求解
尚方寶劍之說
2018-08-03 17:00:36