Ad
  • Custom User Avatar

    This comment is hidden because it contains spoiler information about the solution

  • Custom User Avatar

    Why didn't I think of this? Very clever. As a sidenote, some things to consider here are package size (of Lodash) and execution time. If execution time is faster than your own solution, it may be good to investigate which techniques the package is using under the hood to optimize execution. As for package size, I tend to stray away from helper libraries like Ramda and Lodash, unless the team I'm working on agrees we will use it a lot throughout the app. The less bundle bloat the better!