【每日精进 2025-09】filter(Boolean)

50 阅读1分钟

xxxArr.filter(Boolean)

filter(Boolean) 过滤数组中的假值(falsy values)。包括: false、0、'' (空字符串)、null、undefined、NaN