求数字的平均值
<script> const average = (...args) => args.reduce((a, b) => a + b) / args.length; console.log(average(1, 2, 3, 4));; // Result: 2.5 </script>
<script> const average = (...args) => args.reduce((a, b) => a + b) / args.length; console.log(average(1, 2, 3, 4));; // Result: 2.5 </script>