-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathclass.js
More file actions
33 lines (30 loc) · 718 Bytes
/
class.js
File metadata and controls
33 lines (30 loc) · 718 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
class PenDrive {
constructor(capacity, color, price) {
this.capacity = capacity;
this.color = color;
this.price = price;
}
}
const ignite = new PenDrive("64GB", "White", 600);
console.log(ignite);
const oakWood = new PenDrive("32GB", "White");
console.log(oakWood);
class Mobile {
constructor(specs, color, price) {
this.specs = specs;
this.color = color;
this.price = price;
}
}
const Iphone12ProMAx = new Mobile(
"Screen: 6.5inch, Battery: 4500mAh, Ram: 6GB, Camera: Dual Camera",
"Black",
1300
);
console.log(Iphone12ProMAx);
function StickyNote(color, price) {
this.color = color;
this.price = price;
}
const yellow = new StickyNote("yellow", 40);
console.log(yellow);