function compareHigher(a, b) {
  var numA = parseFloat(/[\d\.]+$/.exec(a)[0]);
  var numB = parseFloat(/[\d\.]+$/.exec(b)[0]);
  if (isNaN(numA) || (numB > numA)) {
    return +1;
  } else if (isNaN(numB) || (numA > numB)) {
    return -1;
  } else {
    return 0;
  }
}
function compareHigher(a, b) {
  var numA = parseFloat(/[\d\.]+$/.exec(a)[0]);
  var numB = parseFloat(/[\d\.]+$/.exec(b)[0]);
  if (isNaN(numA) || (numB > numA)) {
    return +1;
  } else if (isNaN(numB) || (numA > numB)) {
    return -1;
  } else {
    return 0;
  }
}
function compareHigher ( a , b ) { var numA = parseFloat ( / [\d\.]+$ / . exec ( a ) [ 0 ] ) ; var numB = parseFloat ( / [\d\.]+$ / . exec ( b ) [ 0 ] ) ; if ( isNaN ( numA ) || ( numB > numA ) ) { return + 1 ; } else if ( isNaN ( numB ) || ( numA > numB ) ) { return - 1 ; } else { return 0 ; } }
Rank a vs b based on any numeric component in their string.
Rank a vs b based on any numeric component in their string .