Created
March 7, 2016 18:02
-
-
Save kessler/0d657819349adeef1c73 to your computer and use it in GitHub Desktop.
start with, end with (javascript
This file contains hidden or 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 endsWith(str, endsWith) { | |
| return str.substr(str.length - endsWith.length) === endsWith | |
| } | |
| function startsWith(str, startsWith) { | |
| return str.substr(0, startsWith.length) === startsWith | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment