interval-intersection
compute the intersection of two intervals where an interval is a 2 part array
install
npm install interval-intersection
use
var iisect = ; console;// output: [0, 3] console;// output: null
api surface
iisect(a
, b
, out
)
a
is the first intervalb
is the second intervalout
is an optional 2 part araray. Provide this to avoid generating garbage- returns: 2 part array or
null
if no intersection