Created
December 28, 2018 13:53
-
-
Save jongha/eb4406135cda219664962cfa1e4268ba to your computer and use it in GitHub Desktop.
String.prototype.startsWith for IE
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
| if (!String.prototype.startsWith) { | |
| String.prototype.startsWith = function(searchString, position) { | |
| position = position || 0; | |
| return this.indexOf(searchString, position) === position; | |
| }; | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment