forked from scriptEd-HSFI/March-23-objects-with-behavior
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathexercise-06.js
More file actions
40 lines (35 loc) · 699 Bytes
/
exercise-06.js
File metadata and controls
40 lines (35 loc) · 699 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
var student = {
name: "John",
email: "john@gmail.com",
phone: "518-444-5555",
address: {
number: 33,
street: "Christopher St",
city: "New York",
state: "NY",
zip: "12345"
},
classes: [
"math",
"history",
"design",
"accounting"
],
printClasses: function() {
for(var i in this.classes) {
console.log(this.classes[i]);
}
},
printAddress: function() {
for(var j in this.address) {
console.log(j + " : " + this.address[j]);
}
}
};
student.printAddress();
student.printClasses();
/*
Exercise 06:
* Change the attributes of this particular student for other values.
* Run the code to see the effects.
*/