Math.avg = (...numbers) => { let x = 0 numbers.forEach(item => { x += item }) return x / numbers.length } // Usage console.log(Math.avg(10, 20, 30))