Our task was to create a project that exclusively utilized JSON files for data storage. The data structure we were working with resembles the following:
[
{
"aircraftName": "Boeing 747",
"departDate": 1640173020000,
"departure": "Metro Manila, Philippines",
"destination": "Kuala Lumpur, Malaysia",
"estDate": 1640777820000,
"id": "Flight_0001",
"occupancy": 4,
"onboardPassengers": [
{ "passenger": "Person 1", "seat": "A1" },
{ "passenger": "Person 2", "seat": "A2" },
{ "passenger": "Person 3", "seat": "B4" },
{ "passenger": "Person 4", "seat": "C5" }
],
"passengers": 15,
"status": "available",
"depDate": "2021-12-22"
},
{
"aircraftName": "Boeing 868",
"departDate": 1640875620000,
"departure": "Singapore, Singapore",
"destination": "Tokyo, Japan",
"estDate": 1640875620000,
"id": "Flight_0002",
"occupancy": 5,
"onboardPassengers": [
{ "passenger": "Person 1", "seat": "A1" },
{ "passenger": "Person 2", "seat": "A2" },
{ "passenger": "Person 3", "seat": "B4" },
{ "passenger": "Person 4", "seat": "B5" },
{ "passenger": "Person 5", "seat": "A3" }
],
"passengers": 10,
"status": "available",
"depDate": "2021-12-30"
},
{
"aircraftName": "Airbus A350",
"departDate": 1640875860000,
"departure": "Jakarta, Indonesia",
"destination": "Bangkok, Thailand",
"estDate": 1640875860000,
"id": "Flight_0003",
"occupancy": 0,
"onboardPassengers": [],
"passengers": 15,
"status": "available",
"depDate": "2021-12-30"
},
{
"aircraftName": "Airbus A220",
"departDate": 1640876040000,
"departure": "Tokyo, Japan",
"destination": "Beijing, China",
"estDate": 1641624840000,
"id": "Flight_0004",
"occupancy": 0,
"onboardPassengers": [],
"passengers": 15,
"status": "available",
"depDate": "2021-12-30"
},
{
"aircraftName": "Airbus A220",
"departDate": 1640876040000,
"departure": "Tokyo, Japan",
"destination": "Beijing, China",
"estDate": 1641624840000,
"id": "Flight_0005",
"occupancy": 0,
"onboardPassengers": [],
"passengers": 10,
"status": "available",
"depDate": "2021-12-30"
}]
We encountered an issue as we weren't sure how to manipulate and access a JSON file using JavaScript for our browser-based application rather than a Node.js environment. Any suggestions on how to address this challenge would be greatly appreciated.