Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

3
  • I really like this super concise solution :) Commented May 11, 2021 at 9:21
  • Great solution! What I've added to your solution was a filter for empty objects: filter(value => Object.keys(value).length !== 0) in case there are no user keys. Commented May 11, 2021 at 10:41
  • @GeorgeGrigorita: right, added that to the post. Commented May 11, 2021 at 10:43