Group Array By Field Javascript Interview Question