The snippet below will give you the StartWith function for Javascript.

Sample Javascript

String.prototype.startsWith = function(text) {
	return (this.indexOf(text) === 0);
};

2 thought on “StartsWith function for Javascript”

Leave a Reply