-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsettimeout.js
More file actions
64 lines (48 loc) · 1.01 KB
/
settimeout.js
File metadata and controls
64 lines (48 loc) · 1.01 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
58
59
60
61
62
// set timeout and call back
// set time out - if i had a 5 functions . we need to give a time for set a each
// async order - un order
function walk (){
setTimeout(() => {
console.log("walk the dog");
},2000);
}
function clean (){
setTimeout(()=> {
console.log("clean the car");
},5000);
}
function trash (){
setTimeout(() => {
console.log("put the trash out");
},500)
}
walk();
clean();
trash();
// sample : out comes from acceding order low time to high time
// settimeout
function walk(){
setTimeout(()=>{
console.log("5.30 am we can go for walking");
},2000)
}
function read (){
setTimeout(()=>{
console.log("Start studying at 7 am");
},1000)
}
function sleep(){
setTimeout(()=>{
console.log("Get some sleep");
},1500)
}
walk();
read();
sleep();
// task get name in 10 seconds
function name (){
setTimeout(()=>{
console.log("Rijesh");
},10000)
}
name();