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