packageDocumentation module param array param criterion returns note public export function partitionArray < T > ( array , criterion ) { let index = 0 ; let partition = array . length ; while ( index < partition ) { const elem = array [ index ] ; if ( criterion ( elem ) ) { ++ index ; } else { array [ index ] = array [ -- partition ] ; array [ partition ] = elem ; } } return partition ; }