Q:

Append data from multiple forms to store all records in json

I want to continually append form data to a json object
Example of when I submit my form the data looks like this
{"firstName":"jack", "lastName":"miller"} 

However - I need to keep appending that data with a new form submitted so that I can store all the form data 
I would expect that the append of this would be json format so above would have those values and comma separated for each "record"
captureForm = (event) => {

    const data = new FormData(event.target);

    let medicationJSON = JSON.stringify(Object.fromEntries(data));

    allFormData += "," + medicationJSON;
}

Obviously above is more pseudo code , but I don't want to manually add a comma as then its a hack, with a starting comma that I would need to remove.
How can I keep submitting new form and append the data ?
I am using React - but for this , It doesn't seem to be anything for React to be involved with...
Here is a jsfiddle:    Here is a fiddle   https://jsfiddle.net/ua9y185t/ m is set to parse that fordata , i tried various combinations 

A:

Form data append documentation documentation
data.append("firstName", "jack");
data.append("lastName", "miller");
data.append(allData);

The append() method of the FormData interface appends a new value onto an existing key inside a FormData object, or adds the key if it does not already exist.

