Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

find star index of string javascript

if (!String.prototype.startsWith) {
    Object.defineProperty(String.prototype, 'startsWith', {
        value: function(search, rawPos) {
            var pos = rawPos > 0 ? rawPos|0 : 0;
            return this.substring(pos, pos + search.length) === search;
        }
    });
}
Source by developer.mozilla.org #
 
PREVIOUS NEXT
Tagged: #find #star #index #string #javascript
ADD COMMENT
Topic
Name
1+9 =