-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbasic_problems.js
More file actions
57 lines (45 loc) · 1.08 KB
/
Copy pathbasic_problems.js
File metadata and controls
57 lines (45 loc) · 1.08 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
// function func1(){
// setTimeout(()=>{
// console.log(x);
// console.log(y);
// },3000);
// var x = 2;
// let y = 12;
// }
// func1();
// (function(){
// setTimeout(()=> console.log(1),2000);
// console.log(2);
// setTimeout(()=> console.log(3),0);
// console.log(4);
// })();
// let x= {}, y = {name:"Ronny"},z = {name:"John"};
// x[y] = {name:"Vivek"};
// x[z] = {name:"Akki"};
// console.log(x[y]);
// var x = 23;
// (function(){
// var x = 43;
// (function random(){
// x++;
// console.log(x);
// var x=21;
// })();
// })();
// let hero = {
// powerLevel: 99,
// getPower(){
// return this.powerLevel;
// }
// }
// let getPower = hero.getPower;
// let hero2 = {powerLevel:42};
// console.log(getPower());
// console.log(getPower.apply(hero2));
const b = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10];
for (let i = 0; i < 10; i++) {
setTimeout(() => console.log(b[i]), 1000);
}
for (var i = 0; i < 10; i++) {
setTimeout(() => console.log(b[i]), 1000);
}