Driver code
let arr1 = [ new Interval ( 1 , 3 ) , new Interval ( 7 , 9 ) , new Interval ( 4 , 6 ) , new Interval ( 10 , 13 ) ] ; let n1 = arr1 . length ; if ( isIntersect ( arr1 , n1 ) ) document . write ( " " ) ; else document . write ( " " ) ; let arr2 = [ new Interval ( 6 , 8 ) , new Interval ( 1 , 3 ) , new Interval ( 2 , 4 ) , new Interval ( 4 , 7 ) ] ; let n2 = arr2 . length ; if ( isIntersect ( arr2 , n2 ) ) document . write ( " " ) ; else document . write ( " " ) ;