-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcallback.html
54 lines (48 loc) · 1.78 KB
/
callback.html
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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
</head>
<body>
<script>
let stocks={
Fruits: ["strawberry","grapes","banana","apple"],
liquid : ["water","ice"],
holder : ["cone","cup","stick"],
toppings : ["chocolate","penuts"]
}
let order=(Fruits_name,call_production) =>{
setTimeout(()=>{
console.log(`${stocks.Fruits[Fruits_name]}was selected`);
call_production()
},2000)
};
let production =()=>{
setTimeout(()=>{
console.log("production has started");
setTimeout(()=>{
console.log("the fruit has been chopped");
setTimeout(()=>{
console.log(`${stocks.liquid[0]}and ${stocks.liquid[1]}was added`);
setTimeout(()=>{
console.log("the machine was started");
setTimeout(()=>{
console.log(`ice cream was placed on ${stocks.holder[0]}`);
setTimeout(()=>{
console.log(`${stocks.toppings[0]} was added as toppings`);
setTimeout(()=>{
console.log("serve ice cream")
},2000);
},3000);
},2000);
},1000);
},1000);
},2000);
},1000);
};
order("0" ,production);
</script>
</body>
</html>