1.0.0 • Published 8 years ago
closest-array v1.0.0
closest-array
Get the closest value to a given goal from an array.
Usage
const closest = require('closest-array');
closest([ 1, 2, 3 ], 1); // 1
closest([ 10, 20, 30 ], 12); // 10
License
1.0.0
8 years ago