File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11// Predict and explain first...
2+ // I think that it will not run because we're trying to access an object on line 15
3+ // Instead it should be ${adddress[houseNumber]}
24
35// This code should log out the houseNumber from the address object
46// but it isn't working...
@@ -12,4 +14,4 @@ const address = {
1214 postcode : "XYZ 123" ,
1315} ;
1416
15- console . log ( `My house number is ${ address [ 0 ] } ` ) ;
17+ console . log ( `My house number is ${ address [ "houseNumber" ] } ` ) ;
Original file line number Diff line number Diff line change 11// Predict and explain first...
2+ // Because it's trying to iterate through an object
3+ // It should just print author without a loop
24
35// This program attempts to log out all the property values in the object.
46// But it isn't working. Explain why first and then fix the problem
@@ -11,6 +13,4 @@ const author = {
1113 alive : true ,
1214} ;
1315
14- for ( const value of author ) {
15- console . log ( value ) ;
16- }
16+ console . log ( author ) ;
Original file line number Diff line number Diff line change 11// Predict and explain first...
2+ // I think it should use recipe.ingredients instead of recipe at line 15
3+ // Ok I tried it and now I think that it should be done with a loop to list the ingredients
24
35// This program should log out the title, how many it serves and the ingredients.
46// Each ingredient should be logged on a new line
@@ -11,5 +13,8 @@ const recipe = {
1113} ;
1214
1315console . log ( `${ recipe . title } serves ${ recipe . serves }
14- ingredients:
15- ${ recipe } `) ;
16+ ingredients:` ) ;
17+
18+ for ( const i of recipe . ingredients ) {
19+ console . log ( i ) ;
20+ }
You can’t perform that action at this time.
0 commit comments