1var data = {
2 'PropertyA': 1,
3 'PropertyB': 2,
4 'PropertyC': 3
5};
6
7data["PropertyD"] = 4;
8
9// dialog box with 4 in it
10alert(data.PropertyD);
11alert(data["PropertyD"]);
1var myObject = { boo: true, baa: 5 };
2console.log(myObject);
3// expected output:
4// { boo: true, baa:5}
5
6myObject.boo = false;
7myObject.baa++;
8console.log(myObject);
9// expected output:
10// { boo: false, baa:6}
1
2var myDog = {
3 "name": "Coder",
4 "legs": 4,
5 "tails": 1,
6 "friends": ["freeCodeCamp Campers"]
7};
8
9// Update the name value
10myDog.name = "Happy Coder";