Skip to content
Malexion edited this page Nov 3, 2016 · 1 revision

__.math.median(values, [func])

  • values Array of the given values to process.
  • [func] [Optional] Function to process the array with should return the values to process.

Examples

var result = __.math.median([ 1, 5, 22, 2, 3 ]);

console.log(result);

result = __.math.median([
   { value: 1 },
   { value: 5 },
   { value: 22 },
   { value: 2 },
   { value: 3 }
], x => x.value);

console.log(result);