-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathAsync.js
More file actions
41 lines (36 loc) · 759 Bytes
/
Copy pathAsync.js
File metadata and controls
41 lines (36 loc) · 759 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
34
35
36
37
38
39
40
41
/*
function hello(){
console.log("Hello");
}
setTimeout(hello,2000)
*/
/*
console.log("One")
console.log("Two")
setTimeout(()=>{
console.log("Hello");
},4000)
console.log("Three")
console.log("Four")
*/
function getData(dataId , getNextData){
setTimeout(()=>{
console.log("Data",dataId)
if(getNextData){
getNextData();
}
},2000)
}
//Call Back Hell
getData(1,()=>{
console.log("Getting Data2......")
getData(2,()=>{
console.log("Getting Data3......")
getData(3,()=>{
console.log("Getting Data4......")
getData(4,()=>{
console.log("All Data Retrived Successfully")
})
})
})
})