endWith is not a function
解决方法,增加String的扩展
String.prototype.endWith = function(suffix) { return this.indexOf(suffix, this.length - suffix.length) !== -1; };
使用:
"test".endWith("$")
参考:
https://stackoverflow.com/questions/18768344/javascript-endswith-function-not-working
https://stackoverflow.com/questions/280634/endswith-in-javascript