Last active
March 2, 2022 14:49
-
-
Save brendalong/e4f7feee5efbb85bcbf811bc8dd27fc7 to your computer and use it in GitHub Desktop.
Practice Array Iteration and Objects
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
1. Use javascript and the following data to display the Bacon Artichoke pizza on the DOM. | |
Consider which array iteration method you should use. | |
2. Display the number of toppings on the Bacon Artichoke pizza. | |
3. Display the toppings for the Bacon Artichoke pizza with commas between each item. | |
Example display https://jamboard.google.com/d/1J6Lg8w7FKlDDJXhFLAn0nDC8jtnUssq5befgpRZC1Q8/edit?usp=sharing | |
*/ | |
const pizza = [ | |
{ | |
name: "Meat Lovers", | |
cost: 15, | |
crust: "pan" | |
toppings: ["hamburger", "pepperoni", "sausage", "bacon", "cheese"] | |
}, | |
{ | |
name: "Bacon Artichoke", | |
cost: 18, | |
crust: "thin", | |
toppings: ["bacon", "artichoke", "feta cheese"] | |
}, | |
{ | |
name: "Veggie Delight", | |
cost: 12, | |
crust: "original", | |
toppings: ["black olives", "peppers", "onions", "tomato"] | |
} | |
] | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment