Skip to content

Instantly share code, notes, and snippets.

@lachlan-eagling
Created March 16, 2017 22:46
Show Gist options
  • Select an option

  • Save lachlan-eagling/c2af1da13d27ff3963872f4be689c0f1 to your computer and use it in GitHub Desktop.

Select an option

Save lachlan-eagling/c2af1da13d27ff3963872f4be689c0f1 to your computer and use it in GitHub Desktop.
function confirmEnding(str, target) {
var substrStart = str.length - target.length;
if(str.substr(substrStart, str.length) === target){
return true;
} else{
return false;
}
return str;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment