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