Skip to content

Instantly share code, notes, and snippets.

@JamieDixon
Created February 4, 2021 19:56
Show Gist options
  • Save JamieDixon/0bf3253659e98d4ad5fc4eb6ff5f96fc to your computer and use it in GitHub Desktop.
Save JamieDixon/0bf3253659e98d4ad5fc4eb6ff5f96fc to your computer and use it in GitHub Desktop.
const fn = input => input.match(/(\w)\1+|\w{1}/gm).map(x => [x, x.length]);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment