Skip to content

Instantly share code, notes, and snippets.

@ccnixon
Created February 9, 2016 20:21
Show Gist options
  • Save ccnixon/d4977d36212c0467b26b to your computer and use it in GitHub Desktop.
Save ccnixon/d4977d36212c0467b26b to your computer and use it in GitHub Desktop.
Confirm the Ending: Check if a string (first argument) ends with the given target string (second argument).
function end(str, target) {
return str.substring(str.length - target.length) === target;
}
end("Bastian", "n");
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment