{"ScriptPreparationCode":null,"TestCases":[{"Name":"Using For Loop","Code":"const obj = { a: \u0027\u0027, b: null, c: \u0027dog\u0027};\r\n\r\nfor (let propName in obj) {\r\n if (\r\n obj[propName] === null ||\r\n obj[propName] === undefined ||\r\n obj[propName] === \u0027\u0027\r\n ) {\r\n delete obj[propName];\r\n }\r\n}\r\n\r\n// result: {c: \u0027dog\u0027} \r\nconsole.log(obj)","IsDeferred":false},{"Name":"Using Filter and Reduce","Code":"const obj = { a: \u0027\u0027, b: null, c: \u0027dog\u0027};\r\n\r\nconst newObj = Object.entries(obj)\r\n .filter(([key, value]) =\u003E !!value)\r\n .reduce((acc, [key, value]) =\u003E {\r\n acc[key] = value;\r\n return acc;\r\n}, {});\r\n\r\n// result: {c: \u0027dog\u0027} \r\nconsole.log(newObj);","IsDeferred":false}]}