Node.js examples for String:String End
Use indexOf method to check string ends
String.prototype.endsWith = function(suffix) { return this.indexOf(suffix, this.length - suffix.length) !== -1; };