Confusion over challenge

In the challenge it is asking to return the average of numbers but the parameter is a number , singular number. Am I missing something or it the challenge missing something because average is

adding all the numbers in a data set together, then dividing that total by the total count of numbers in the set.

My code

function square(num: number) {
  return num * num;
}

const result = square(5);

console.log(result);

function getAverage(arr){
  return typeof arr
}
console.log(getAverage(1));

Link to challenge https://www.freecodecamp.org/learn/front-end-development-libraries-v9/workshop-type-safe-math-toolkit/step-8

you are passing one single number to the function, but with a parameter name like arr, I would expect it to accept an array

It says so here:

Your function should return the average for an array of numbers.

The initial problem was i asked console for what typeof it said singular number. so when I used forEach it gave me error

TypeError: arr.forEach is not a function

so really the question is confusing me because forEach and reduce both work with array.

Hi @mahassan

As @ILM suggested, try calling the function by passing in an array.

console.log(getAverage([2,4,6,8]));

Happy coding