ie 7/8不支持trim的属性的解决方案

if(!('trim' in String.prototype)){
    String.prototype.trim = function(){
        return this.replace(/^[suFEFFxA0]+|[suFEFFxA0]+$/g,'');
    }
}

console.log('(' + ' aaa '.trim() + ')');

原文地址:https://www.cnblogs.com/gongshunkai/p/5859149.html