I have an array: [1, 2, 3, 4, 5, 6...100]
I am looking to iterate over this array by 5, specifically:
Take the first 5 numbers of the array and get the average, move on to the next 5 numbers and get the average, and so on..
I have tried numerous methods such as a Dequeue
and for loops but have not been able to get the outcome desired.
Try this:
You need to use a progression loop to iterate each 5 element and use reduce to sum the subsequence then divide the total by the subsequence elements count: