I have two separate arrays containing information. One array includes the title of each national park and other related data, while the second array consists of alerts from the entire NPS system. The common factor between these arrays is the parkCode. How can I organize them by national park? For instance:
- Yellowstone National Park - alert from Yellowstone
- Arches National Park - alert from Arches
Here is a snippet of the data I am dealing with:
National Park Names:
0:
description: "."
designation: "National Park"
directionsInfo: "From Boston take I-95 north to Augusta, Maine, then
Route 3 east to Ellsworth, and on to Mount Desert Island. For an
alternate route, continue on I-95 north to Bangor, Maine, then take
Route 1A east to Ellsworth. In Ellsworth, take Route 3 to Mount Desert
Island."
directionsUrl: "http://www.nps.gov/acad/planyourvisit/directions.htm"
fullName: "Acadia National Park"
id: "6DA17C86-088E-4B4D-B862-7C1BD5CF236B"
latLong: "lat:44.30777545, long:-68.30063316"
name: "Acadia"
**parkCode: "acad"**
states: "ME"
url: "https://www.nps.gov/acad/index.htm"
Example Alert:
113:
category: "Park Closure"
description: "The Elwha area is closed indefinitely to vehicle traffic
beyond Madison Falls parking lot due to extensive flood damage to the
Olympic Hot Springs Road. There is limited parking and turnaround space
at the Madison Falls parking area."
id: "84646EA9-1DD8-B71B-0BD7AECDC56BD8AE"
**parkCode: "acad"**
title: "Elwha (Olympic Hot Springs) Road Closed to Vehicle Access"
url: "https://www.nps.gov/olym/planyourvisit/current-road-conditions.htm"