Skip to content

Instantly share code, notes, and snippets.

@Chun-Yang
Last active August 3, 2017 19:32
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Chun-Yang/d57681f30729cc3f642bc42e9dcda9ae to your computer and use it in GitHub Desktop.
Save Chun-Yang/d57681f30729cc3f642bc42e9dcda9ae to your computer and use it in GitHub Desktop.
function getFirstNumber(text) {
const matches = text.match(/\d+/)
return matches ? parseInt(matches[0]) : 0
}
$$('.issue-card').map(c => getFirstNumber(c.innerText)).reduce((a, b) => a + b, 0)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment