Take for example this "StartsWith" extension:
if (typeof String.prototype.startsWith != 'function') {
String.prototype.startsWith = function (str) {
return this.slice(0, str.length) == str;
};
}
If I was writing a web app, I would stick that code in an ExtensionMethods.js
page that I imported on a web page within my site.
But what about the case of using this on the server with Node.js?
Thanks!