For storing data that is more complex than that which is stored in a configuration file, JSON format is more appropriate. This format is quite popular, particularly among those who use the JavaScript language.
We are going to read and parse the data/sales.json file. This file contains a single anonymous object, which contains two arrays—"products" and "sales".
The "products" array contains two objects, each one having three fields:
"products": [
{
"id": 591,
"category": "fruit",
"name": "orange"
},
{
"id": 190,
"category": "furniture",
"name": "chair"
}
],
The "sales" array contains three objects, each one containing five fields:
"sales": [
{
"id": "2020-7110",
"product_id": 190,
"date":...