Last active
October 1, 2015 09:40
-
-
Save waltzaround/756ceccc475064921904 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function end(str, target) { // as we input the first and second arguments into the function... | |
return target === str.substr(str.length - target.length); // we check if the first string ends with the second string, and return the second argument | |
return str; // and return the first argument | |
} | |
end("Bastian", "n", ""); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment