Skip to content

Latest commit

 

History

History
26 lines (17 loc) · 683 Bytes

README.md

File metadata and controls

26 lines (17 loc) · 683 Bytes

closest-number

CI status npm version npm

Find the closest number out of an array to a specific value

Install

$ npm i closest-number

Usage

const closestNumber = require('closest-number');

closestNumber([10, 20, 30], 12);
// => 10

License

MIT © André Ruffert