自定义JavaScript中的endWith函数
String.prototype.endsWith = function(suffix) { return this.indexOf(suffix, this.length - suffix.length) !== -1; };
//or
function endsWith(str, suffix) { return str.indexOf(suffix, str.length - suffix.length) !== -1; }
自定义JavaScript中的endWith函数
String.prototype.endsWith = function(suffix) { return this.indexOf(suffix, this.length - suffix.length) !== -1; };
//or
function endsWith(str, suffix) { return str.indexOf(suffix, str.length - suffix.length) !== -1; }