Implement `frequency(arr)` returning an object mapping each value to how many times it appears.
Run your code to see results.