param a param b returns export default function intersection < T , X > ( a , b ) { const intersection = new Map ( ) ; const [ lessEntries , other ] = a . size < b . size ? [ a , b ] : [ b , a ] ; for ( const [ key ] of lessEntries ) { if ( other . has ( key ) ) { intersection . set ( key , a . get ( key ) ) ; } } return intersection ; }