Skip to content

Instantly share code, notes, and snippets.

@denmch
Created December 22, 2015 00:05
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 denmch/12c44b56160981183982 to your computer and use it in GitHub Desktop.
Save denmch/12c44b56160981183982 to your computer and use it in GitHub Desktop.
"Check if a string (first argument) ends with the given target string (second argument)."
function end(str, target) {
var ending = str.substring(str.length - target.length);
return target === ending;
}
end("Bastian", "n");
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment