An array is one of the most common concepts of Javascript, which gives us a lot of possibilities to work with data. Check these tricks which can be...
For further actions, you may consider blocking this person and/or reporting abuse
Better to do
As the Boolean constructor is called on falsey values and returns false to filter them.
Although the absolutely best way is to not allow falsey values into an array for processing, then no work is needed
Good article. IT helps JavaScript developers to do some array operations in much better way.
Hi, can I suggest that you put your code into a code block rather than using a screenshot? If you paste it in between three-backticks you get something like this:
and that's something that'll help you with:
Thanks Ben for the heads up,much appreciated!!
Remove falsy values from an array:
Why convert to a Boolean when JS is going to do that anyway? That's the whole point of truey/falsy values