1.0.0 • Published 10 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); // 10License
1.0.0
10 years ago