0
I have an object with the following values:
let sel = {
"1": { "id_turma": 485, "codigo_turma": "1112A - 41", "ano_ciclo": 14 },
"2": { "id_turma": 486, "codigo_turma": "1112B - 27", "ano_ciclo": 18 },
"3": { "id_turma": 487, "codigo_turma": "1112C - 24", "ano_ciclo": 14 }
}
I need to turn into an array like this:
valor['1112A'] => 14
valor['1112B'] => 18
valor['1112C'] => 14
I tried so:
let val = []
sel.forEach(function(ix) {
if(ix.value) {
val[ix.value] = ix.ano_ciclo
}
})
It’s not working out
And numbers 41, 27 and 24 in
codigo_turma
? Must be ignored?– Woss
@Andersoncarloswoss are just information. They should be ignored
– Luis Souza