xnn_9 1.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/index.js +94 -0
  2. package/package.json +12 -0
package/index.js ADDED
@@ -0,0 +1,94 @@
1
+ // const p1 = new Promise((resolve) => {
2
+ // setTimeout(() => resolve("Promise 1 ishladi"), 3000);
3
+ // });
4
+
5
+ // const p2 = new Promise((resolve) => {
6
+ // setTimeout(() => resolve("Promise 2 ishladi"), 1000);
7
+ // });
8
+
9
+ // const p3 = new Promise((resolve) => {
10
+ // setTimeout(() => resolve("Promise 3 ishladi"), 2000);
11
+ // });
12
+
13
+ // Promise.race([p1, p2, p3])
14
+ // .then(result => {
15
+ // console.log("Birinchi resolve bo'lgan:", result);
16
+ // });
17
+
18
+ // class Animal {
19
+ // constructor(name) {
20
+ // if (this.constructor === Animal) {
21
+ // throw new Error("Animal abstract class!");
22
+ // }
23
+ // this.name = name;
24
+ // }
25
+
26
+ // sound() {
27
+ // throw new Error("sound() method majburiy!");
28
+ // }
29
+ // }
30
+ // class Dog extends Animal {
31
+ // sound() {
32
+ // return "Vov-vov";
33
+ // }
34
+ // }
35
+
36
+ // class Cat extends Animal {
37
+ // sound() {
38
+ // return "Miyov";
39
+ // }
40
+ // }
41
+
42
+ // class Cow extends Animal {
43
+ // sound() {
44
+ // return "Moo";
45
+ // }
46
+ // }
47
+ // const dog = new Dog("Rex");
48
+ // const cat = new Cat("Mosh");
49
+ // const cow = new Cow("Olabek");
50
+
51
+ // console.log(dog.name, dog.sound());
52
+ // console.log(cat.name, cat.sound());
53
+ // console.log(cow.name, cow.sound());
54
+
55
+ // class MathUtils {
56
+ // static add(a, b) {
57
+ // return a + b;
58
+ // }
59
+
60
+ // static multiply(a, b) {
61
+ // return a * b;
62
+ // }
63
+
64
+ // static isEven(number) {
65
+ // return number % 2 === 0;
66
+ // }
67
+ // }
68
+
69
+ // console.log(MathUtils.add(3, 5));
70
+ // console.log(MathUtils.multiply(4, 2));
71
+ // console.log(MathUtils.isEven(10));
72
+
73
+ // class User {
74
+ // #password;
75
+
76
+ // constructor(username, password) {
77
+ // this.username = username;
78
+ // this.#password = password;
79
+ // }
80
+
81
+ // setPassword(newPassword) {
82
+ // this.#password = newPassword;
83
+ // }
84
+
85
+ // getPassword() {
86
+ // return this.#password;
87
+ // }
88
+ // }
89
+ // const user1 = new User("admin", "12345");
90
+
91
+ // console.log(user1.getPassword());
92
+
93
+ // user1.setPassword("99999");
94
+ // console.log(user1.getPassword());
package/package.json ADDED
@@ -0,0 +1,12 @@
1
+ {
2
+ "name": "xnn_9",
3
+ "version": "1.0.2",
4
+ "description": "",
5
+ "license": "ISC",
6
+ "author": "Murodbek Muhammadov",
7
+ "type": "commonjs",
8
+ "main": "index.js",
9
+ "scripts": {
10
+ "test": "echo \"Error: no test specified\" && exit 1"
11
+ }
12
+ }