James S. answered 04/16/20
Specializing in Full-Stack Development, SQL, JavaScript, HTML, and CSS
1) Create a JavaScript function that takes 2 arguments.
2) To calculate the mean value it is "The sum divided by the count"
For example, 5+6+7=20 -> 20/3 = 6.67 (Mean).
So to do this.
- Use a for loop.
- add up the values in your data array
- divide by limit
- return the results
3) Refine your loop to start at a specific point in the data array (data.length - limit)
4) Loop through the elements in the array and add them together
5) Divide by limit.
6) Return result.
If you need further explanation, feel free to contact me and we can schedule a time.