Skip to content

Instantly share code, notes, and snippets.

@wctej89
Created November 7, 2019 21:41
Show Gist options
  • Save wctej89/2fddf4ccd34d04e47230ae1107388b90 to your computer and use it in GitHub Desktop.
Save wctej89/2fddf4ccd34d04e47230ae1107388b90 to your computer and use it in GitHub Desktop.
urls = ['angry', 'sad', 'meh', 'like', 'superlike']
i = -1
foo = ->
i++
urls[i]
a = '--reactreaction-- dsfsfd --reactreaction-- dsfsf --reactreaction-- sdfsdfdsf --reactreaction-- sdfsdfsf --reactreaction--'
a.replace /--reactreaction--/g, foo # => 'angry dsfsfd sad dsfsf meh sdfsdfdsf like sdfsdfsf superlike'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment