1
I have the following variable with several objects inside:
const dados = {
estudouNaFaculdadeAno: {
metricas: {
ano: [],
invalido: {
num: 0,
palavras: []
}
}
},
estudouNaFaculdadeCurso: {
metricas: {
curso: {
ads: 0,
grh: 0,
gpi: 0
},
invalido: {
num: dados.estudouNaFaculdadeAno.metricas.invalido.num,
palavras: dados.estudouNaFaculdadeAno.metricas.invalido.palavras
}
}
}
}
When executing a console.log(dados)
i get the following error code:
Uncaught ReferenceError: Cannot access 'dados' before initialization at dados.js:550
Could someone help me understand why? How do I get him to reference without having this problem?
PS.: This.js data file contains only the constant dados
with the values to be read by other functions that are in other files . js
Oops, you gave me such a light @Sam ! Thank you so much for your help :)
– Leonardo Dias