closest-number
v1.0.3
Published
Find the closest number out of an array to a specific value
Downloads
83
Readme
closest-number
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