var x = 5;
const name = 'Homer';
let homer = {
first: name,
last: 'Simpson'
};
homer.first = 'H';
const marge = {
first: 'Homer',
last: 'Simpson'
};
var h = homer;
var family = [homer, marge];
Statement 1: var x = 5;
Identifier | Memory Location | Value | typeof | Value Locked |
---|---|---|---|---|
x | VAL001 | 5 | number |
Statement 2 const name = 'Homer';
Identifier | Memory Location | Value | typeof | Value Locked |
---|---|---|---|---|
x | VAL001 | 5 | number | |
name | VAL002 | 'Homer' | string | 🔒 |
Statement 3 let homer = { first: name, last: 'Simpson' };
Identifier | Memory Location | Value | typeof | Value Locked |
---|---|---|---|---|
x | VAL001 | 5 | number | |
name | VAL002 | 'Homer' | string | 🔒 |
homer | VAL003 | REF:OBJ001 | Object | |
OBJ001 | { first: 'Homer', last: 'Simpson } | Object |
Statement 4 homer.first = 'H';
Identifier | Memory Location | Value | typeof | Value Locked |
---|---|---|---|---|
x | VAL001 | 5 | number | |
name | VAL002 | 'Homer' | string | 🔒 |
homer | VAL003 | REF:OBJ001 | Object | |
OBJ001 | { first: 'H', last: 'Simpson } | Object |