Answers for "javascript const memory"

0

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.
Posted by: Guest on March-04-2022
0

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.
Posted by: Guest on March-04-2022

Code answers related to "Javascript"

Browse Popular Code Answers by Language