0

If I have an array of objects.

[
  {
    "zipCode": "Zip code 1",
    "name": "County one",
  },
  {
    "zipCode": "Zip code 2",
    "name": "County two",
  },
]

I have an another div which currently shows the 'zipCode' as a string value, i.e

<p>Zip Code 1</p>

But I want to display the name based on the zipCode value. How could I map over the data and return the name based on the zipCode value? and display that value in the p tag, Any idea's?

Sole
  • 3,100
  • 14
  • 58
  • 112

0 Answers0