I am creating a calendar program, and my aim is to save events and so on in a JSON file. What I think is the best way to do so is by storing arrays inside arrays in the JSON file (this way I can iterate through each array and load them when the program starts).
First and foremost: how do I push an array into an array in JSON? Any suggestions? Say for example I have variable var event
that is equal to an array {"id": elementTitle, "year": year, "month": month, "day": day};
that is going to be JSON.stringify(event)
'ed. So how do I save this to an array already created in a JSON file?: events = { }
.
By the way, this program is created with the electron api, also using node.js.