closest-number

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

MIT License

Downloads
116
Stars
4
Committers
3

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

Package Rankings
Top 11.61% on Npmjs.org
Badges
Extracted from project README
CI status npm version npm