Skip to content

Instantly share code, notes, and snippets.

@alex-cory
Created January 19, 2017 04:56
Show Gist options
  • Save alex-cory/37537d285b575c521a4d36288979fbbd to your computer and use it in GitHub Desktop.
Save alex-cory/37537d285b575c521a4d36288979fbbd to your computer and use it in GitHub Desktop.
JavaScript helper functions
function includesAll (string, ...values) {
return values.every(el => string.includes(el))
}
function replaceAll (originalString, string2replace, replaceWith) {
return originalString.split(string2replace).join(replaceWith)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment