const fn = (a,b)=>a+b; const a = [1,2,3]; const b = [4,5,6]; Array.prototype.sum = function(...args){ return this.reduce(...args)}; console.log(a.sum(fn, b.sum(fn)))//21