- Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathscript.js
More file actions
Latest commit
54 lines (40 loc) · 807 Bytes
/
Copy pathscript.js
File metadata and controls
54 lines (40 loc) · 807 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
41
42
43
44
45
46
47
48
functionfunc(s){
for(variins){
console.log(i);
}
}
functionMultiplier(){
this.currentValue=null;
this.multiply=function(num){
if(this.currentValue==null){
this.currentValue=num*1;
returnnum*1;
}
else{
this.currentValue*=num;
returnthis.currentValue;
}
}
this.getCurrentValue=function(){
returnthis.currentValue;
}
}
functionphoto(name,location){
this.name=name;
this.location=location;
}
functionalbum(){
this.photos=[];
}
varM1=newMultiplier();
varp1=newphoto("mahedi","queens");
varp2=newphoto("John","Manhattan");
vara1=newalbum();
a1.photos[0]=p1;
a1.photos[1]=p2;
//alert(M1.multiply(2));
//alert(M1.multiply(5));
func(M1);
func(p1);
for(i=0;i<a1.photos.length;i++)
alert(a1.photos[i].location);