I have a Javascript object like:
var my_object = { a:undefined, b:2, c:4, d:undefined };
How to remove all the undefined properties? False
if you are using lodash, you can use _.compact(array) to remove all falsely values from an array.
_.compact(array)
_.compact([0, 1, false, 2, '', 3]); // => [1, 2, 3]
https://lodash.com/docs/4.17.4#compact