I'm trying to traverse attributes of a json, I'm trying that way
for (var i = 0, length = r.length; i < length; i++) {
for (var i2 = 0,length = r[i].lenght; i2 < length; i2++ ){
console.log("teste"+r[i][i2]);
}
}
How do I do this correctly?
Json is coming in irregularly, because when the service receives a null value from the bank it does not jump to the json field
[
{
"nome": "Victor Siqueira",
"login": "[email protected]",
"senha": "ef797c8118f02dfb649607dd5d3f8c7623048c9c063d532cc95c5ed7a898a64f",
"tempoSessao": 15,
"acesso": [
{
"idTela": "AA00"
}
]
},
{
"nome": "",
"tempoSessao": 0,
"acesso": []
},
{
"nome": "",
"login": "as",
"senha": "1234",
"tempoSessao": 0,
"acesso": []
},
{
"nome": "",
"login": "as2",
"senha": "9876",
"tempoSessao": 0,
"acesso": []
},
{
"nome": "",
"login": "as3",
"senha": "9876",
"tempoSessao": 0,
"acesso": []
},
{
"nome": "",
"login": "as4",
"senha": "a123",
"tempoSessao": 0,
"acesso": []
},
{
"nome": "",
"login": "as5",
"senha": "54d5cb2d332dbdb4850293caae4559ce88b65163f1ea5d4e4b3ac49d772ded14",
"tempoSessao": 0,
"acesso": []
},
{
"nome": "",
"login": "PFernandes",
"senha": "54d5cb2d332dbdb4850293caae4559ce88b65163f1ea5d4e4b3ac49d772ded14",
"tempoSessao": 0,
"acesso": []
},
{
"nome": "",
"tempoSessao": 0,
"acesso": []
},
{
"nome": "",
"tempoSessao": 0,
"acesso": []
},
{
"nome": "",
"tempoSessao": 0,
"acesso": []
},
{
"nome": "",
"tempoSessao": 0,
"acesso": []
},
{
"nome": "",
"tempoSessao": 0,
"acesso": []
},
{
"nome": "",
"tempoSessao": 0,
"acesso": []
},
{
"nome": "",
"tempoSessao": 0,
"acesso": []
},
{
"nome": "",
"tempoSessao": 0,
"acesso": []
},
{
"nome": "",
"tempoSessao": 0,
"acesso": []
}
]