So, I have this object containing country names as keys and the values are arrays with some cities. I want to get all the cities in one array, without the countries. Here\'s how
As per documentation of Array.prototype.concat:
Returns a new array comprised of this array joined with other array(s) and/or value(s).
Which means it does not modify the object it is applied to.
Change to:
allCities = allCities.concat(cities[c]);