3
I have the following json
{
"error": false,
"installments": {
"visa": [{
"quantity": 1,
"installmentAmount": 500.00,
"totalAmount": 500.00,
"interestFree": true
}, {
"quantity": 2,
"installmentAmount": 261.28,
"totalAmount": 522.55,
"interestFree": false
}]
}
}
This object visa, can be changed depending on the call but only this object, can come as Bradesco, Itau, etc.
There is a way to access the information of this object without being by its explicit name (installments.visa)?
Somehow play on a variable like this:
var cartao = installments.(truquemagico);
And access the data like this:
console.log(cartao[0].totalAmount);