prefixed Array. to reduce(), sort(), map() methods in snippets.
This commit is contained in:
@ -1,6 +1,6 @@
|
||||
### Average of array of numbers
|
||||
|
||||
Use `reduce()` to add each value to an accumulator, initialized with a value of `0`, divide by the `length` of the array.
|
||||
Use `Array.reduce()` to add each value to an accumulator, initialized with a value of `0`, divide by the `length` of the array.
|
||||
|
||||
```js
|
||||
const average = arr =>
|
||||
|
||||
Reference in New Issue
Block a user