const result = grop.reduce((acc, el) => acc.concat(el, city.filter((c) => c.idMain === el.idParent)), []);
/*
[
{
"name": "merseded",
"groupName": "avto",
"idParent": "11"
},
{
"name": "test1",
"idMain": "11"
},
{
"name": "test2",
"idMain": "11"
},
{
"name": "test4",
"idMain": "11"
},
{
"name": "bmv",
"groupName": "avto",
"idParent": "20"
},
{
"name": "test3",
"idMain": "20"
}
]
*/
const getRandomLatLng = () => {
return {
lat: +(Math.random() * (90 - (-90)) + (-90)).toFixed(4),
lng: +(Math.random() * (180 - (-180)) + (-180)).toFixed(4)
}
}