Skip to content

Commit 49fa7d1

Browse files
authored
merge: improve median (TheAlgorithms#869)
* median * [TheAlgorithms/pull/869] make fn pure * [TheAlgorithms/pull/869/] pure averageMedian fn * [TheAlgorithms/pull/869] formatter
1 parent 0aa5094 commit 49fa7d1

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

Maths/AverageMedian.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,8 @@
88
* else if the length of the array is odd number, the median value will be the middle number in the array
99
*/
1010

11-
const averageMedian = (numbers) => {
11+
const averageMedian = (sourceArrayOfNumbers) => {
12+
let numbers = [...sourceArrayOfNumbers]
1213
let median = 0
1314
const numLength = numbers.length
1415
numbers = numbers.sort(sortNumbers)

0 commit comments

Comments
 (0)