过滤数组中的空字符串

var data = [‘’, ‘    ‘, ‘            ’, ‘sdf’, ‘sdgfa’, ‘  ’];

data.trim()  // [‘sdf’, ‘sdgfa’]

// 注:IE9(不包含IE9)以下的版本没有trim()方法

原文地址:https://www.cnblogs.com/yuanyuanya/p/15170067.html