test proximal range of number values
Test the proximal range of values
npm install closeness
The constructor takes 2 parameters, the target value, and the proximal range you want to test. It returns a function which takes a singe value as an argument, and return true or false if it is close enough.
var howClose = require'closeness';var close = howClose100 5 // returns a fn that will test if your number is with 5 of 100ifclose96 console.log'yep its close enough'if!close50 console.log'not close enough'
MIT I GUESS