js filter out false values from an array

0, undefined, null, false, "", ''can easily be omitted by

const array = [3, 0, 6, 7, '', false];
array.filter(Boolean);
// 输出
(3) [3, 6, 7]

Guess you like

Origin blog.csdn.net/z591102/article/details/123898566