Skip to content

Instantly share code, notes, and snippets.

@KaKi87
Created May 8, 2019 16:06
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 KaKi87/5e346826bebdb31c54915924ccb3304a to your computer and use it in GitHub Desktop.
Save KaKi87/5e346826bebdb31c54915924ccb3304a to your computer and use it in GitHub Desktop.
JS : indexOf all matches
const indexOfAll = (string, value) => string.split('').reduce((a, e, i) => (e === value) ? a.concat(i) : a, []);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment