Skip to content

rosszurowski/nearby

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 

Repository files navigation

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

About

Finds elements in an array that are within a given distance threshold.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published