You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 23f1985
Browse filesBrowse the repository at this point in the historyBrowse files
Copy file name to clipboardExpand all lines: Sprint-2/debug/address.js
+2-1Lines changed: 2 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -1,4 +1,5 @@
1
1
// Predict and explain first...
2
+
// that it will throw a undefined error because the address object is not defined in the code snippet. The code snippet is missing the definition of the address object, which is necessary for the console.log statement to work correctly.
2
3
3
4
// This code should log out the houseNumber from the address object
4
5
// but it isn't working...
@@ -12,4 +13,4 @@ const address = {
12
13
postcode: "XYZ 123",
13
14
};
14
15
15
-
console.log(`My house number is ${address[0]}`);
16
+
console.log(`My house number is ${address.houseNumber}`);
Copy file name to clipboardExpand all lines: Sprint-2/debug/author.js
+2-1Lines changed: 2 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -1,4 +1,5 @@
1
1
// Predict and explain first...
2
+
// will throw a TypeError because Object.values() is not a function. The correct way to get the values of an object is to use Object.values(author) instead of Object.values(author). The code is trying to call Object.values() on the author object, which is not a function, hence the error.
2
3
3
4
// This program attempts to log out all the property values in the object.
4
5
// But it isn't working. Explain why first and then fix the problem
Copy file name to clipboardExpand all lines: Sprint-2/debug/recipe.js
+5-3Lines changed: 5 additions & 3 deletions
Original file line number
Diff line number
Diff line change
@@ -1,4 +1,5 @@
1
1
// Predict and explain first...
2
+
// will log out the title and how many it serves, but it will not log out the ingredients on new lines. The ingredients are in an array, and the current code does not iterate over that array to log each ingredient on a new line.
2
3
3
4
// This program should log out the title, how many it serves and the ingredients.
0 commit comments