Skip to content

Instantly share code, notes, and snippets.

@kessler
Created March 7, 2016 18:02
Show Gist options
  • Save kessler/0d657819349adeef1c73 to your computer and use it in GitHub Desktop.
Save kessler/0d657819349adeef1c73 to your computer and use it in GitHub Desktop.
start with, end with (javascript
function endsWith(str, endsWith) {
return str.substr(str.length - endsWith.length) === endsWith
}
function startsWith(str, startsWith) {
return str.substr(0, startsWith.length) === startsWith
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment