I have a JSON stringified object as:
{
"lesseeName": "Padyster-7",
"lesseeRegNo": "12345",
"lesseeVatNo": "4456",
"telFaxNo": "1234567891",
"billingAddress": {
"addressId": null,
"addressLine1": "XYz , l1 street",
"addressLine2": "near xyz bank",
"postalCode": "60000",
"countryName": "MY",
"cityName": "Kuala lumpur",
"stateProvinceCode": "Kuala lumpur"
},
"mlaList": [{
"mlaNo": 92,
"lesseeId": 108,
"executionDate": "27/01/2017",
"signatoryInfo": "Test",
"overdueRate": 3.44,
"nonPaymentDays": 2,
"consolidationTerm": "Monthly",
"createdBy": null,
"createdDtm": null,
"updatedBy": null,
"updatedDtm": null,
"statusIndicator": null,
"signatoryEmail": "[email protected]",
"leaseMlaNo": "OPM1",
"statusDescription": "APPROVED"
}, {
"mlaNo": 93,
"lesseeId": 108,
"executionDate": "03/01/2017",
"signatoryInfo": "tess",
"overdueRate": 5.77,
"nonPaymentDays": 2,
"consolidationTerm": "Bi-Monthly",
"createdBy": null,
"createdDtm": null,
"updatedBy": null,
"updatedDtm": null,
"statusIndicator": null,
"signatoryEmail": "[email protected]",
"leaseMlaNo": "OPM2",
"statusDescription": "APPROVED"
}]
}
I am working in Reactjs and I want my object to be iterated such that the inner array mlaList of objects gets iterated to display value one after other.
whenever I try using the .map function to the parent object I get an error saying ".map is not a function" below is the iteration I attempt which fails:
{data.map((data, index) => {data.leaseMlaNo} {data.signatoryEmail})}
I have referred to the SO questions quite similar to this one, but they just talk about iterating the objects using Object.keys
Please help me understand what I am doing wrong and what should be the correct way to achieve this
See Question&Answers more detail:
os