JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 79170
  • Score
    100M100P100Q164187F
  • License MIT

Get the median value in an array

Package Exports

  • ml-array-median

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (ml-array-median) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

array-median

NPM version npm download

Get the median value in an array, this median use the Floyd-Rivest algorithm.

Thanks to mad-gooze for his median-quickselect lib.

Some benchmarks here.

Installation

$ npm install --save ml-array-median

Usage

import median from 'ml-array-median';

const result = median([1, 5, 3, 2, 4]);
// 3

License

MIT