upskilling-said 1.0.1

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.
@@ -0,0 +1,335 @@
1
+ // // // // console.log(test())
2
+
3
+ // // // // var test = function(){
4
+ // // // // return hello()
5
+ // // // // function hello(){return 5}
6
+
7
+ // // // // var hello = function (){return 10}
8
+ // // // // }
9
+
10
+ // // // // // var x = 5
11
+ // // // // // console.log(x);
12
+
13
+ // // // // // var number = 0
14
+
15
+ // // // // // let Name = "Ahmed"
16
+ // // // // // console.log(Name.length);
17
+
18
+ // // // // // // let star = ""
19
+
20
+ // // // // // // for(var i = Name.length -1 ; i>=0;i--){
21
+
22
+ // // // // // // star+=Name[i]
23
+
24
+ // // // // // // }
25
+ // // // // // // console.log(star);
26
+
27
+ // // // // // // var num1 = window.prompt("Enter first number")
28
+ // // // // // // var num2 = window.prompt("Enter secand number")
29
+ // // // // // // var op = window.prompt("Enter operator")
30
+
31
+ // // // // // // if(op == "+"){
32
+ // // // // // // console.log(Number(num1) + Number(num2));
33
+
34
+ // // // // // // }
35
+
36
+ // // // // // function test (){
37
+ // // // // // var hello = function(){return 5}
38
+
39
+ // // // // // return hello()
40
+
41
+ // // // // // var hello = function (){return 10}
42
+ // // // // // }
43
+
44
+ // // // // // console.log(test())
45
+
46
+ // // // // // function test (){
47
+ // // // // // return hello()
48
+
49
+ // // // // // function hello(){return 5}
50
+
51
+ // // // // // var hello = function (){return 10}
52
+ // // // // // }
53
+
54
+ // // // // // console.log(test())
55
+
56
+ // // // // // function test (){
57
+ // // // // // function hello(){return 5}
58
+
59
+ // // // // // return hello()
60
+
61
+ // // // // // function hello(){return 10}
62
+ // // // // // }
63
+
64
+ // // // // // console.log(test())
65
+
66
+ // // // // // /**
67
+ // // // // // *
68
+
69
+ // // // // // */
70
+
71
+ // // // // // /**
72
+
73
+ // // // // // // 2
74
+
75
+ // // // // // // 3
76
+
77
+ // // // // // // 4
78
+
79
+ // // // // // */
80
+ // // // // // self-invoked-Function
81
+
82
+ // // // // // for (let i = 0; i < 10; i++) {
83
+ // // // // // console.log("hello");
84
+ // // // // // }
85
+
86
+ // // // // let i = 0;
87
+
88
+ // // // // while (i < 5) {
89
+ // // // // console.log("hello");
90
+ // // // // i++;
91
+ // // // // }
92
+
93
+ // // // // // let i = 200
94
+ // // // // // do {
95
+
96
+ // // // // // console.log("hello");
97
+ // // // // // i++
98
+
99
+ // // // // // } while (i<100);
100
+
101
+ // // // let userName = document.getElementById("name");
102
+ // // // let email = document.getElementById("email");
103
+ // // // let phone = document.getElementById("phone");
104
+ // // // let Address = document.getElementById("Address");
105
+
106
+ // // // let productContainer = [];
107
+ // // // function addUser() {
108
+ // // // let user = {
109
+ // // // name: userName.value,
110
+ // // // email: email.value,
111
+ // // // phone: phone.value,
112
+ // // // Address: Address.value,
113
+ // // // };
114
+
115
+ // // // productContainer.push(user);
116
+ // // // displayProduct()
117
+ // // // }
118
+
119
+ // // // function displayProduct(){
120
+ // // // let shanta = ''
121
+ // // // for (let i = 0; i < productContainer.length; i++) {
122
+
123
+ // // // shanta +=`<tr>
124
+ // // // <th scope="row">1</th>
125
+ // // // <td>${productContainer[i].name}</td>
126
+ // // // <td>${productContainer[i].email}</td>
127
+ // // // <td>${productContainer[i].phone}</td>
128
+ // // // <td>${productContainer[i].Address}</td>
129
+
130
+ // // // </tr>`
131
+
132
+ // // // }
133
+
134
+ // // // document.getElementById("body").innerHTML =shanta
135
+ // // // }
136
+
137
+ // // // function greet(name) {
138
+ // // // return `Hello ${name}`;
139
+ // // // }
140
+
141
+ // // // function processUserInput(callback) {
142
+ // // // const name = "Saad";
143
+ // // // console.log(callback(name));
144
+ // // // }
145
+
146
+ // // // processUserInput(greet);
147
+
148
+ // // // function sayHello(name){
149
+ // // // return `hello ${name}`
150
+ // // // }
151
+
152
+ // // // function ayhaga(x){
153
+
154
+ // // // let name = "said"
155
+
156
+ // // // console.log(x(name));
157
+ // // // }
158
+ // // // ayhaga(sayHello)
159
+
160
+ // // function saveCount (){
161
+
162
+ // // let count = 0
163
+
164
+ // // return function(){
165
+ // // count++
166
+ // // return count
167
+ // // }
168
+ // // }
169
+
170
+ // // let counter = saveCount()
171
+ // // console.log(counter());
172
+
173
+ // // // function increament(){
174
+ // // // let count = 0
175
+
176
+ // // // return function(){
177
+ // // // count++
178
+ // // // console.log(count);
179
+ // // // }
180
+ // // // }
181
+
182
+ // // // spread operator
183
+ // // // let counter = increament()
184
+
185
+ // // // counter()
186
+ // // // counter()
187
+ // // // counter()
188
+ // // // counter()
189
+
190
+ // // // document.addEventListener("keydown",(e)=>{
191
+
192
+ // // // // if(e.code =="Space"){
193
+
194
+ // // // // }
195
+
196
+ // // // })
197
+
198
+ // // // setInterval(function(){
199
+ // // // let r = Math.floor(Math.random()*255)
200
+ // // // let g = Math.floor(Math.random()*255)
201
+ // // // let b = Math.floor(Math.random()*255)
202
+
203
+ // // // document.body.style.backgroundColor = `rgb(${r} , ${g},${b})`
204
+ // // // },1000)
205
+
206
+ // // // "use strict"
207
+
208
+ // // // var x = "said"
209
+ // // // delete x
210
+
211
+ // // // // console.log(x);
212
+
213
+ // // let person = {
214
+ // // name : "Saad",
215
+ // // age : 25,
216
+ // // salary : 5000,
217
+ // // sayHello:function(){
218
+ // // return this.name
219
+ // // },
220
+ // // calcSalary:function(){
221
+
222
+ // // let ali = this
223
+
224
+ // // function calcProfit(){
225
+ // // console.log(this);
226
+ // // return 0.1 * ali.salary
227
+ // // }
228
+
229
+ // // console.log(this);
230
+ // // return this.salary - calcProfit()
231
+ // // }
232
+
233
+ // // }
234
+
235
+ // // console.log(person.sayHello());
236
+ // // console.log(person.calcSalary());
237
+
238
+ // // if([]==[]){
239
+ // // console.log("true");
240
+ // // }
241
+ // // else{ console.log("false");
242
+ // // }
243
+
244
+ // // let num1 = [1,2,3]
245
+ // // let num2 = num1
246
+
247
+ // // num2.push(4)
248
+
249
+ // // console.log(num1);
250
+
251
+ // function pizza(x){
252
+ // fetch("https://forkify-api.herokuapp.com/api/search?q=pizza").then(function(response){
253
+ // return response.json()
254
+
255
+ // }).then(function(){
256
+
257
+ // console.log("pizza");
258
+ // x()
259
+
260
+ // })
261
+
262
+ // }
263
+ // function fish(){
264
+ // fetch("https://forkify-api.herokuapp.com/api/search?q=fish").then(function(response){
265
+ // return response.json()
266
+
267
+ // }).then(function(){
268
+
269
+ // console.log("fish");
270
+
271
+ // })
272
+
273
+ // }
274
+ // function watermelon(){
275
+ // fetch("https://forkify-api.herokuapp.com/api/search?q=watermelon").then(function(response){
276
+ // return response.json()
277
+
278
+ // }).then(function(){
279
+
280
+ // console.log("watermelon");
281
+
282
+ // })
283
+
284
+ // }
285
+
286
+ // // console.log("hello1");
287
+
288
+ // pizza(fish)
289
+ // // fish()
290
+ // watermelon()
291
+ // // console.log("hello2");
292
+
293
+ function one() {
294
+ console.log("one");
295
+
296
+ return new Promise(function (resolve, reject) {
297
+
298
+ let error = false
299
+
300
+ if(error){
301
+
302
+ reject()
303
+ }
304
+ else{
305
+ resolve()
306
+ }
307
+
308
+
309
+ });
310
+ }
311
+
312
+ function two(){
313
+ console.log("two");
314
+ return new Promise(function(resolve, reject){
315
+ let error = true
316
+
317
+ if(error){
318
+ reject()
319
+ }
320
+ else{
321
+ resolve()
322
+ }
323
+
324
+ })
325
+ }
326
+ function three(){
327
+ console.log("three");
328
+ }
329
+
330
+
331
+ function printError(){
332
+ console.log("error happened ya saada");
333
+ }
334
+
335
+ one().then(two).then(three).catch(printError)