JoseIgnacioRetamalThomsen / FinalYearProject

Microservices application.
0 stars 0 forks source link

Getting just the City from API array #55

Open MakarenkoElena91 opened 4 years ago

MakarenkoElena91 commented 4 years ago

Problem: returning back the whole array, need to return just locality Solution:

result[0].address_components.filter(address => address.types.includes('locality'))[0].long_name

ref: https://stackoverflow.com/a/56598506