We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 5384212 commit bb878d2Copy full SHA for bb878d2
js-coding-technique/removeEmptyKeys.js
@@ -0,0 +1,5 @@
1
+export const removeEmptyKeys = (obj) =>
2
+ Object.entries(obj).reduce(
3
+ (accumulator, [key, value]) => (value ? ((accumulator[key] = value), accumulator) : accumulator),
4
+ {},
5
+ );
0 commit comments