I need to filter an array so it would remove undefined objects from it.

I tried with lodash _.filter but didn't succeed (returned completely empty array)
_.filter(myArray, _.isEmpty)
I'm using Angular 6 so anything with typescript or lodash would be perfect.
An easier way:
_.filter(myArray, Boolean)
This rids the array of nulls, 0's and undefined's.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With