-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathasynawait.html
46 lines (39 loc) · 1.16 KB
/
asynawait.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
<!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 is_shop_open = true;
let toppings_choice = () => {
return new Promise((resolve, reject)=>{
setTimeout(()=>{
resolve(
console.log("which topping would you love?"));
},3000);
});
};
async function kitchen(){
console.log(" A ");
console.log(" B ");
console.log(" C ");
await toppings_choice();
console.log(" D ");
console.log(" E ");
}
kitchen();
console.log("doing the dishes");
console.log("cleaing the table");
console.log("taking others orders");
</script>
</body>
</html>