.filterFalsy()

Presentation

Remove every falsy element from array.

Value
Description

false

The keyword false.

0

The Number zero (so, also 0.0, etc., and 0x0).

"", '', ``

Empty string value.

null — the absence of any value.

undefined — the primitive value.

Usage

Example

[3, 2, 1, null, undefined, 0, '', false].filterFalsy() // [3, 2, 1]

Additional Informations

References:

Last updated