- Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathtest.js
More file actions
Latest commit
33 lines (27 loc) · 946 Bytes
/
Copy pathtest.js
File metadata and controls
33 lines (27 loc) · 946 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
//--------------------------------------------------------------------------//
// Address Object //
//--------------------------------------------------------------------------//
functionAddress(){
this.address=newObject();
}
Address.prototype={
set: function(firstname,lastname,country,zip,city){
this.address.firstname=firstname;
this.address.lastname=lastname;
this.address.country=country;
this.address.zip=zip;
this.address.city=city;
},
get: function(){
returnthis.address;
},
print: function(){
console.log('Address: '+JSON.stringify(this.address,0,1));
}
};
//------------------------------------------------------------------------------//
// Usage //
//------------------------------------------------------------------------------//
varMyAddress=newAddress();
MyAddress.set("Rainer","Ross","DE","86916","Kaufering");
MyAddress.print();