js数组的方法

一、JS中去除数组中的假值(0, 空,undefined, null, false)

1.Array.filter()
arr.filter(Boolean)

二、JS中去除数组中重复

1.[...new Set(arr)]
【待续】

你可能感兴趣的:(js数组的方法)