function localeComparator(a, b) {
  const areBothStrings = (typeof a == "string") && (typeof b == "string");
  if (areBothStrings) {
    return a.localeCompare(b, "da");
  }

  if (a > b)
    return 1;
  if (a < b)
    return -1;
  return 0;
}
/*
 * Compares object using localeCompare on strings
 */
Compares object using localeCompare on strings
Compares object using localeCompare on strings
function localeComparator(a, b) {
  const areBothStrings = (typeof a == "string") && (typeof b == "string");
  if (areBothStrings) {
    return a.localeCompare(b, "da");
  }
  if (a > b)
    return 1;
  if (a < b)
    return -1;
  return 0;
}
function localeComparator ( a , b ) { const areBothStrings = ( typeof a == "string" ) && ( typeof b == "string" ) ; if ( areBothStrings ) { return a . localeCompare ( b , "da" ) ; } if ( a > b ) return 1 ; if ( a < b ) return - 1 ; return 0 ; }
Compares object using localeCompare on strings
Compares object using localeCompare on strings