“JavaScript Const Memory” Respostas de código

JavaScript Const Memory

// Create a memory unit and label it as V
// This label cannot be discarded or reused
const V = { id: 42 };

// Later in the program
V = []; // TypeError: Assignment to constant variable.
Puzzled Puffin

JavaScript Const Memory

// You can do:
V.id = 37; // No errors

console.log(V.id); // 37

// But you still can't do:
V = { id: 37 }; // TypeError: Assignment to constant variable.
Puzzled Puffin

Respostas semelhantes a “JavaScript Const Memory”

Perguntas semelhantes a “JavaScript Const Memory”

Mais respostas relacionadas para “JavaScript Const Memory” em JavaScript

Procure respostas de código populares por idioma

Procurar outros idiomas de código