Created
February 9, 2016 20:21
-
-
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).
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) { | |
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