如果重寫了JavaScript中的原型方法,則可以調用基礎方法嗎?MyClass = function(name){ this.name = name; this.do = function() { //do somthing }};MyClass.prototype.do = function() { if (this.name === 'something') { //do something new } else { //CALL BASE METHOD }};
使用JavaScript原型的調用方法
牛魔王的故事
2019-12-10 10:21:37