“JavaScript const Memory” Code-Antworten

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

Ähnliche Antworten wie “JavaScript const Memory”

Fragen ähnlich wie “JavaScript const Memory”

Weitere verwandte Antworten zu “JavaScript const Memory” auf JavaScript

Durchsuchen Sie beliebte Code-Antworten nach Sprache

Durchsuchen Sie andere Codesprachen