Skip to content

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

License

Notifications You must be signed in to change notification settings

andreruffert/closest-number

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

32 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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