export class Comparator < T > { constructor ( private _compareFunction = primitiveCompare ) { } equal ( a , b ) { return this . _compareFunction ( a , b ) ; } } export function primitiveCompare < T > ( a , b ) { return a === b ; }