I have created a form similar to this one: https://jsfiddle.net/6vocc2yn/ that generates a JSON output like below:
{
"List": [
{
"Id": 10,
"Name": "SDB_SOLOCHALLENGE_CHALLENGE_DESC_10",
"email": "<a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="4e2f2c2d602f2c2d0e363734602d2123">[email protected]</a>",
"message": "SDB_SOLOCHALLENGE_CHALLENGE_BACKGROUND_IMAGE_10",
"someOtherList": [
{
"a": 10,
"b": 14
}
],
"opponentFighterItemDefinitionId": 4294967295,
"title": "abc"
}
]
}
I am looking to add an 'Add' button that will reset the current fields, save the information, and append the new input provided by the user next time.
For example:
{
"List": [
{
"Id": 10,
"Name": "CHALLENGE_DESC_10",
"email": "<a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="d2b3b0b1fcb3b0b192aaaba8fcb1bdbf">[email protected]</a>",
"message": "BACKGROUND_IMAGE_10",
"someOtherList": [
{
"a": 10,
"b": 14
}
],
"oppId": 111,
"title": "abc"
},
{
"Id": 11,
"Name": "CHALLENGE_DESC_11",
"email": "<a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="117073723f7073725169686b3f727e7c">[email protected]</a>",
"message": "CHALLENGE_BACKGROUND_IMAGE_11",
"someOtherList": [
{
"a": 11,
"b": 15
}
],
"oppId": 222,
"title": "abc"
}
]
}
What is the most effective way to merge using .push method?