nearby
v0.0.3
Published
Finds elements in an array that are within a given distance threshold.
Downloads
3
Readme
Nearby
Finds elements in an array that are within a given distance threshold.
This is useful for generating random numbers that don't collide, or have ample distance between them.
Usage
var nearby = require('nearby')
var near = nearby(5)
var arr = [1, 5, 10, 25, 40, 42]
near(arr, 12) // true
near(arr, 19) // false
License
MIT