Groups the elements of an array by a specified key generated from each element.
This function iterates over the provided array and uses a key-generating function
(keyFunc) to determine the key for each element. The result is an object where
each key is associated with an array of elements that share the same key.
Groups the elements of an array by a specified key generated from each element.
This function iterates over the provided array and uses a key-generating function (
keyFunc) to determine the key for each element. The result is an object where each key is associated with an array of elements that share the same key.