function avg(...args) { return args.reduce((pre, cur) => (pre + cur) / args.length); } console.log(avg(4,5,6)); ///5