It is now time to implement Array.prototype.groupBy.
Your task is to write an implementation of the function Array.prototype.groupBy based on the specification and the knowledge you have gained in Modules 1-5.
There is no need to start on groupByToMap yet, as this can be implemented by just modifying the groupBy function (this is a part of Module 7).
Remember to adhere to the specification as much as possible. This makes it easier to ensure compliance the functionality outlined by the specification.
Tips:
- Look at other implementations of previous features with similar specification.
- Use Searchfox to search the codebase.
- Create tests to test the functionality implemented.