Boolean 是一个函数,它会对遍历数组中的元素,并根据元素的真假类型,对应返回 true 或 false.
1  | b = a.filter(Boolean);  | 
它等价于
1  | b = a.filter(function (x) { return Boolean(x); });  | 
Boolean 是一个函数,它会对遍历数组中的元素,并根据元素的真假类型,对应返回 true 或 false.
1  | b = a.filter(Boolean);  | 
它等价于
1  | b = a.filter(function (x) { return Boolean(x); });  |