I have a function which gives three objects
function myfunc(one, two, three){
this.one = one;
this.two = two;
this.three = three;
}
var a = new myfunc(6,5,7);
var b = new myfunc(10,4,2);
var c = new mufunc(20,1,8);
This gives the three separate objects which are useful. However, i want to create a forth object which is the sum of a,b and c. In effect this would be the same as:
var all = new myfunc(36, 10, 17);
I can do this manually:
aa = a.one + b.one + c.one
bb = a.two + b.two + c.two
cc = a.three + b.three + c.three
var all = new myfunc(aa, bb, cc)
but is there a better way which is less manual.