1var person={
2 first_name:"johnny",
3 last_name: "johnson",
4 phone:"703-3424-1111"
5};
6for (var property in person) {
7 console.log(property,":",person[property]);
8}
1let storeItems = {
2 eggs: {
3 price: 3.77, quantity: 30
4 },
5
6 milk: {
7 price: 2.22, quantity: 23
8 },
9
10 butter: {
11 price: 2.00, quantity: 22
12 },
13
14 carrots: {
15 price: 3.00, quantity: 11
16 },
17
18 beef: {
19 price: 6.18, quantity: 34
20 },
21 chicken: {
22 price: 5.44, quantity: 34
23 }
24 };
25
26 for(let item in storeItems) {
27 console.log(`${storeItems[item].quantity} ${item}s each cost ${storeItems[item].price}`);
28}
29
30
31// //OUTPUT:“30 eggs each cost 3.77”
32// “23 milks each cost 2.22”
33// “22 butters each cost 2”
34// “11 carrots each cost 3”
35// “34 beefs each cost 6.18”
36// “34 chickens each cost 5.44”
37