参考地址 https://developer.mozilla.org/zh-CN/docs/Web/JavaScript/Reference/Global_Objects/String/Trim
语法:
string.trim()
去掉字符串两边的空白字符
eg:
var a = ["A", 'B','',null,undefined, ' ','C']; console.log(a.filter(function (p1) {return p1 && trim(p1);}));