Skip to content

Instantly share code, notes, and snippets.

@srph
Created October 13, 2018 02:53
Show Gist options
  • Save srph/f67d9cb4145d5b69e1e91d7a0b699006 to your computer and use it in GitHub Desktop.
Save srph/f67d9cb4145d5b69e1e91d7a0b699006 to your computer and use it in GitHub Desktop.
JS: Sort by h4 text
x.sort((a, b) => z(a) > z(b))
function z(str) {
return (<h4 style="text-align: center;">)[A-Za-z\,\s]+(<\/h4>)/.exec(str)[0].replace('<h4 style="text-align: center;">', '').replace('</h4>', '').replace(', CA', '')
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment