-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathexercise.js
More file actions
115 lines (90 loc) · 2.31 KB
/
Copy pathexercise.js
File metadata and controls
115 lines (90 loc) · 2.31 KB
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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
// ex1/////
// function showAddress(address){
// for(let key in address)
// console.log(key,address[key]);
// }
// let address= {
// street:'kastruba',
// city:`ratlam`,
// zip:457001
// };
// // console.log(address);
// showAddress(address); //call bhi to krna pdta h saaleee
//ex 2
// factory function
// function createAdd(street,city,zip){
// return{ street,
// city,
// zip
// };
// }
// const add1=createAdd('kas','tur','basd');
// console.log(add1);
//constructor function
// function CreateAdd(street,city,zip){
// this.street=street;
// this.city=city;
// this.zip=zip;
// }
// let add1=new CreateAdd('kas','tur','basd'); /// newwwwwwww is important
// console.log(add1);
// ex 3//////
// function CreateAdd(street,city,zip){
// this.street=street;
// this.city=city;
// this.zip=zip;
// }
// let add1=new CreateAdd('kas','tur','basd'); /// newwwwwwww is important
// let add2=new CreateAdd('kas','tur','basd'); /// newwwwwwww is important
// let add3= add1;
// // console.log(add1);
// function areEqual(add1,add2){
// return add1.street===add2.street&&
// add1.city===add2.city&&
// add1.zip===add2.zip;
// }
// function areSame(add1,add2){
// return add1===add2;
// }
// console.log(areEqual(add1,add2));
// console.log(areSame(add1,add2)); //same nhi h to false show krega
// console.log(areSame(add1,add3));
// ex4//////
// const post ={
// title: 'a',body:'sda',
// author:'asdas',
// views:234,
// comments:[ {author: 'ss', body:'d'},
// {author: 'sfdss', body:'as'}
// ],
// isLive: true
// };
// console.log(post);
// /ex5//////
// const post ={
// title: 'a',body:'sda',
// author:'asdas',
// views:234,
// comments:[ {author: 'ss', body:'d'},
// {author: 'sfdss', body:'as'}
// ],
// isLive: true
// };
// console.log(post);
// function Post(title,body,author){
// this.body=body;
// this.title=title;
// this.author=author;
// this.views=0;
// this.comments=[];
// this.isLive=false;
// }
// let book=new Post('asd','dasa','asdasd');
// console.log(book);
//////ex 6//////
let priceRanges =[
{label:'$', tooltip:'i', minPerPerson:0,maxPerPerson:10},
{label:'$', tooltip:'i', minPerPerson:11,maxPerPerson:20},
{label:'$', tooltip:'i', minPerPerson:21,maxPerPerson:50}
];
let restaurants=[ avgPerPerson=6];