-
Notifications
You must be signed in to change notification settings - Fork 12
/
console-1690866334559.log
89 lines (73 loc) · 4.33 KB
/
console-1690866334559.log
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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
async function makeNetworkCall(){
try{
const response = await fetch(URL); // Block
const object = await response.json(); // Block
return object; // Wrap Promise
}
catch(err){
console.log('Some Problem in API Call ', err);
throw err;
}
}
undefined
async function makeNetworkCall(){
try{
const response = await fetch(URL);
console.log('Response ' ,response);
const object = await response.json();
console.log('JSON ' ,obj);
return object; // Wrap Promise
}
catch(err){
console.log('Some Problem in API Call ', err);
throw err;
}
}
undefined
async function makeNetworkCall(){
try{
const response = await fetch('https://gist.githubusercontent.com/kshirsagarps/36fade16fa39202715656ef487aaf7b0/raw/2b682e589ef283f06be42d2799dfa54f57794a6e/Pizza.json');
console.log('Response ' ,response);
const object = await response.json();
console.log('JSON ' ,obj);
return object; // Wrap Promise
}
catch(err){
console.log('Some Problem in API Call ', err);
throw err;
}
}
undefined
const p = doNetworkCall();
p.then(data=>console.log(data)).catch(e=>console.log(e));
VM463:1 Uncaught ReferenceError: doNetworkCall is not defined
at <anonymous>:1:11
(anonymous) @ VM463:1
const p = makeNetworkCall();
p.then(data=>console.log(data)).catch(e=>console.log(e));
Promise {<pending>}
VM229:4 Response Response {type: 'cors', url: 'https://gist.githubusercontent.com/kshirsagarps/36…682e589ef283f06be42d2799dfa54f57794a6e/Pizza.json', redirected: false, status: 200, ok: true, …}
VM229:10 Some Problem in API Call ReferenceError: obj is not defined
at makeNetworkCall (<anonymous>:6:31)
VM466:2 ReferenceError: obj is not defined
at makeNetworkCall (<anonymous>:6:31)
async function makeNetworkCall(){
try{
const response = await fetch('https://gist.githubusercontent.com/kshirsagarps/36fade16fa39202715656ef487aaf7b0/raw/2b682e589ef283f06be42d2799dfa54f57794a6e/Pizza.json');
console.log('Response ' ,response);
const object = await response.json();
console.log('JSON ' ,object);
return object; // Wrap Promise
}
catch(err){
console.log('Some Problem in API Call ', err);
throw err;
}
}
undefined
const p = makeNetworkCall();
p.then(data=>console.log(data)).catch(e=>console.log(e));
Promise {<pending>}
VM488:4 Response Response {type: 'cors', url: 'https://gist.githubusercontent.com/kshirsagarps/36…682e589ef283f06be42d2799dfa54f57794a6e/Pizza.json', redirected: false, status: 200, ok: true, …}body: (...)bodyUsed: trueheaders: Headers {}ok: trueredirected: falsestatus: 200statusText: ""type: "cors"url: "https://gist.githubusercontent.com/kshirsagarps/36fade16fa39202715656ef487aaf7b0/raw/2b682e589ef283f06be42d2799dfa54f57794a6e/Pizza.json"[[Prototype]]: Response
VM488:6 JSON {Vegetarian: Array(3)}Vegetarian: Array(3)0: {id: 10, name: 'Vegan Veggie', price: '23.95', menu_description: 'Daiya vegan mozzarella, paired with fresh veggies', classifications: {…}, …}assets: menu: [{…}]product_details_page: Array(1)0: {url: 'https://assets.zumepizza.com/public/aq89hll9.jpg'}length: 1[[Prototype]]: Array(0)[[Prototype]]: Objectclassifications: {vegetarian: true}id: 10menu_description: "Daiya vegan mozzarella, paired with fresh veggies"name: "Vegan Veggie"price: "23.95"toppings: (8) [{…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}][[Prototype]]: Object1: assets: {menu: Array(1), product_details_page: Array(1)}menu: Array(1)0: url: "https://assets.zumepizza.com/public/nfjqscxz.jpg"[[Prototype]]: Objectlength: 1[[Prototype]]: Array(0)product_details_page: Array(1)0: {url: 'https://assets.zumepizza.com/public/aq89hll9.jpg'}length: 1[[Prototype]]: Array(0)[[Prototype]]: Objectclassifications: {vegetarian: true}id: 11menu_description: "The freshest, locally sourced veggies"name: "Veggie Zupreme"price: "19.95"toppings: (9) [{…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}][[Prototype]]: Object2: {id: 12, name: 'The O.G.', price: '16.95', menu_description: 'The Margherita—with California flair', classifications: {…}, …}length: 3[[Prototype]]: Array(0)[[Prototype]]: Object
VM491:2 {Vegetarian: Array(3)}