_compare-by-length.js 223 B

123456789
  1. // Used internally to sort array of lists by length
  2. "use strict";
  3. var toPosInt = require("../../number/to-pos-integer");
  4. module.exports = function (arr1, arr2) {
  5. return toPosInt(arr1.length) - toPosInt(arr2.length);
  6. };