Last active
July 3, 2017 08:08
-
-
Save kulakowka/fce222f684e819ac59fbaee2e941bbb7 to your computer and use it in GitHub Desktop.
Magic by @n4kz
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'AAAABBHHJOPPPP' | |
.replace(/(\w)\1+/g, (match) => match[0] + (match.length)); | |
// => "A4B2H2JOP4" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment