Skip to content

Instantly share code, notes, and snippets.

@erictleung
Created November 27, 2015 10:34
Show Gist options
  • Save erictleung/121d99704346270be4db to your computer and use it in GitHub Desktop.
Save erictleung/121d99704346270be4db to your computer and use it in GitHub Desktop.
Return true/false on whether the target string is at the end of a given string.
function end(str, target) {
return str.substr(str.length - target.length) == target;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment