function average(nums) { // nums.length is the important part return nums.reduce((a, b) => (a + b)) / nums.length; }