Created
December 22, 2015 00:05
-
-
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)."
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) { | |
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