function usersCountByCity(users) { let object = {}; for (const { city } of users) { object[city] ??= 0; object[city] += 1; } return object; }