import id from './_id'; import cmp from './_cmp'; import type {compareFn, mapFn} from './_types'; /** * Compares two arrays. * @param x an array * @param y another array * @param fc compare function (a, b) * @param fm map function (v, i, x) * @returns xy: 1 */ function compare(x: T[], y: T[], fc: compareFn=null, fm: mapFn=null): number { var fc = fc||cmp, fm = fm||id; var X = x.length, Y = y.length; for(var i=0, I=Math.min(X, Y); i