abapvc ⋅ JavaScript面向对象详... ⋅ 最后由 abapvc 于2018年02月12日回复
我指类方法就像java里面的static方法。Math.round()对我来说就是类方法或静态方法。
自己找到答案了
function Student() { alert("prototpye"); }; Student.prototype.say = function () { alert("Say instance"); } Student.say = function () { alert("Say static"); } var student = new Student(); student.say(); Student.say();
15
30
60
90
JavaScript面向对象详...