据我所知,Javascript(至少现在已经存在)不支持运算符重载。
我能建议的最好的方法是使用一个类方法从其他几个对象中创建新的配额对象。这是我的意思的简单示例:
// define an example "class"var NumClass = function(value){ this.value = value;}NumClass.prototype.toInteger = function(){ return this.value;}// Add a static method that creates a new object from several othersNumClass.createFromObjects = function(){ var newValue = 0; for (var i=0; i<arguments.length; i++){ newValue += arguments[i].toInteger(); } return new this(newValue)}并像这样使用它:
var n1 = new NumClass(1);var n2 = new NumClass(2);var n3 = new NumClass(3);var combined = NumClass.createFromObjects(n1, n2, n3);



