Created
March 7, 2018 18:45
-
-
Save webbower/283f84d9a8de289dbf4c23d455fdde4a to your computer and use it in GitHub Desktop.
Simple and common misc JS utils to pick from as needed
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 beginsWith(baseStr, targetStr) { | |
return baseStr.indexOf(targetStr) === 0; | |
} | |
function endsWith(baseStr, targetStr) { | |
return baseStr.substr(-targetStr.length) === targetStr; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment