code: function collationIndex(x) {
    var id = ['boolean', 'number', 'string', 'object'];
    var idx = id.indexOf(typeof x);
    //false if -1 otherwise true, but fast!!!!1
    if (~idx) {
      if (x === null) {
        return 1;
      }
      if (Array.isArray(x)) {
        return 5;
      }
      return idx < 3 ? (idx + 2) : (idx + 3);
    }
    if (Array.isArray(x)) {
      return 5;
    }
  }
docs: The collation is defined by erlangs ordered terms the atoms null, true, false come first, then numbers, strings, arrays, then objects null/undefined/NaN/Infinity/-Infinity are all considered null