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