-
-
Notifications
You must be signed in to change notification settings - Fork 9.1k
en/lc/2705/ #2849
-
Beta Was this translation helpful? Give feedback.
All reactions
-
🚀 2
Replies: 1 comment 4 replies
-
I think there is slight flaw here.
When obj
is array, a new array is returning,
but when obj
is object, the input data is changed at the same time
Beta Was this translation helpful? Give feedback.
All reactions
-
Hello, the solution has been updated. Thank you for your feedback.
Beta Was this translation helpful? Give feedback.
All reactions
-
👍 1
-
Line 8,
I guess, it will be better to filter array before using of .map(compactObject)
Beta Was this translation helpful? Give feedback.
All reactions
-
❤️ 1
-
You are right. I have made the change. Thank you~
Beta Was this translation helpful? Give feedback.
All reactions
-
❤️ 1
-
Also the same works for lines 11-14
They can be replaced with
if (value) { acc[key] = compactObject(value); }
Beta Was this translation helpful? Give feedback.
All reactions
-
👍 1