我们知道,给JavaScript类添加原形(prototype)方法是很简单的。而且常用的有下面这两种方法,可是这两种方法在使用时有区别吗? JScript Class: function JSClass() { } Extends prototype method: JSClass.prototype.MethodA = function() { }; Or function = JSClass.prototype.MethodA() { }; 相关文章: 2022-12-23 2022-01-28 2022-12-23 2022-12-23 2021-11-28 2021-10-16