Since Boolean
is a function you can write this:
[].filter(Boolean);
This is a equal to:
function myBooleanFilter(value) {
return Boolean(value);
}
[].filter(myBooleanFilter);
Since Boolean
is a function you can write this:
[].filter(Boolean);
This is a equal to:
function myBooleanFilter(value) {
return Boolean(value);
}
[].filter(myBooleanFilter);