'use strict' ; returns export function findFirst < T > ( array , p ) { let low = 0 , high = array . length ; if ( high === 0 ) { return 0 ; } while ( low < high ) { let mid = Math . floor ( ( low + high ) / 2 ) ; if ( p ( array [ mid ] ) ) { high = mid ; } else { low = mid + 1 ; } } return low ; } export function includes < T > ( array , item ) { return array . indexOf ( item ) !== - 1 ; } export function union < T > ( ... arrays ) { const result = [ ] ; for ( const array of arrays ) { for ( const item of array ) { if ( ! includes ( result , item ) ) { result . push ( item ) ; } } } return result ; }