Skip to content

Commit 013e56d

Browse files
authored
Update address.js
1 parent 5a797a0 commit 013e56d

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

‎Sprint-2/debug/address.js‎

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,9 @@ const address = {
1212
postcode: "XYZ 123",
1313
};
1414

15-
console.log(`My house number is ${address[0]}`);
15+
console.log(`My house number is ${address.houseNumber}`);
16+
// console.log(`My house number is ${address[0]}`);
17+
18+
// The original syntax works for array and not for object.
19+
// it will show undefine message
20+
// Instead use the correct . operator to access the object field values

0 commit comments

Comments
 (0)