* fix: added info and solutions for stubs * fix: made title match main header * fix: removed wrong closing tag Co-Authored-By: Oliver Eyton-Williams <ojeytonwilliams@gmail.com> * fix: added closing tag Co-Authored-By: Oliver Eyton-Williams <ojeytonwilliams@gmail.com> * fix: corrected solution Co-Authored-By: Oliver Eyton-Williams <ojeytonwilliams@gmail.com> * fix: changed verbiage Co-Authored-By: Oliver Eyton-Williams <ojeytonwilliams@gmail.com> * fix: added code tags Co-Authored-By: Oliver Eyton-Williams <ojeytonwilliams@gmail.com> * fix: added solution
19 lines
307 B
Markdown
19 lines
307 B
Markdown
---
|
|
title: Averages/Root mean square
|
|
---
|
|
# Averages/Root mean square
|
|
|
|
---
|
|
## Solutions
|
|
|
|
<details><summary>Solution 1 (Click to Show/Hide)</summary>
|
|
|
|
```javascript
|
|
function rms(arr) {
|
|
const sumOfSquares = arr.reduce((s, x) => s + x * x, 0);
|
|
return Math.sqrt(sumOfSquares / arr.length);
|
|
}
|
|
```
|
|
|
|
</details>
|