




Sponsored
Sponsored
Use these hints if you're stuck. Try solving on your own first.
First declare an object that will eventually be returned.
Iterate of each element in the array. You can access the array with the "this" keyword.
The key is fn(arr[i]). If the key already exists on the object, set the value to be an empty array. Then push the value onto the array at the key.