如果要声明对象的“非静态”方法,则应使用原型。var myObject = function () {};myObject.prototype.getA = function (){ alert("A");};myObject.getB = function (){ alert("B");};myObject.getB(); // This works finemyObject.getA(); // Error!var myPrototypeCopy = new myObject();myPrototypeCopy.getA(); // This works, too.