I wanted to create a function that calculate the average between some numbers. I wanted to make it that i could put as many numbers as i wanted in the console.log but this code apparently doesn't work, when i console.log it says "infinity". Need help please
function avg(...args){
return args.reduce(function (a, b) {
return a + b / avg.length
})
}
console.log(avg(1, 2, 3, 4, 5))