After using JSON.stringify()
on an array in JavaScript, the resulting data appears as follows:
[
{
"typeOfLoan":"Home"
},
{
"typeOfResidency":"Primary"
},
{
"downPayment":"5%"
},
{
"stage":"Just Looking"
},
{
"firstName":"Jared"
},
{
"lastName":"Example"
},
{
"email":"<a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="9dd7fceff8f9ddf9f8f0f2b3fef2f0">[email protected]</a>"
},
{
"cell":"8888888888"
},
{
"loanofficer":"Jim Loan"
}
]
I need to convert this structure into a standard JSON object for POST submission. Despite researching various solutions and attempting them all, I am still encountering syntax errors that I cannot resolve. The array is stored in the variable jsonArray
.