0
When creating a constant and then adding it as a property within an object, the object understands that it is from it (i.e., that it is the same thing), but at that moment I will have the const name and the aluno1.name (two different variables). How does this work underneath? I can’t understand this logic...
const aluno1 = {
nome,
};
console.log(nome); // Pedro
console.log(aluno1.nome); // Pedro
aluno1.nome = "José";
console.log(nome); // Pedro
console.log(aluno1.nome); // José
the name is variable?
– novic
It is a constant but could be a tb Let
– Victor Rafaeli