skip to main content
beutner.dev

Boolean is a function

Since Boolean is a function you can write this:

[].filter(Boolean);

This is a equal to:

function myBooleanFilter(value) {
return Boolean(value);
}

[].filter(myBooleanFilter);