Skip to content

Commit 6a0643a

Browse files
committed
explain and fix the bug in address
1 parent 4222cda commit 6a0643a

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

‎Sprint-2/debug/address.js‎

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
// Predict and explain first...
22

3+
// address[0] will not work here as we have an object of key-value pairs. instead of square bracket notation we need the dot notation with the key
4+
// I would think it returns undefined.
5+
36
// This code should log out the houseNumber from the address object
47
// but it isn't working...
58
// Fix anything that isn't working
@@ -12,4 +15,4 @@ const address = {
1215
postcode: "XYZ 123",
1316
};
1417

15-
console.log(`My house number is ${address[0]}`);
18+
console.log(`My house number is ${address.houseNumber}`);

0 commit comments

Comments
 (0)