Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save ElliotFriend/4dae0ac3c95d0002d1c2 to your computer and use it in GitHub Desktop.
Save ElliotFriend/4dae0ac3c95d0002d1c2 to your computer and use it in GitHub Desktop.
http://www.freecodecamp.com/elliotfriend 's solution for Bonfire: Confirm the Ending
// Bonfire: Confirm the Ending
// Author: @elliotfriend
// Challenge: http://www.freecodecamp.com/challenges/bonfire-confirm-the-ending
// Learn to Code at Free Code Camp (www.freecodecamp.com)
function end(str, target) {
// "Never give up and good luck will find you."
// -- Falcor
if (str.substr(target.length * -1) === target) {
return true;
} else {
return false;
}
}
end("Bastian", "n");
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment