1fetch('https://api.github.com/users/kipngetich33')
2 .then(response => response.json())
3 .then(formatedResponse => console.log(formatedResponse))
4//NB please replace url with your own
1fetch('/about').then(function (response) {
2 // The API call was successful!
3 return response.text();
4}).then(function (html) {
5
6 // Convert the HTML string into a document object
7 var parser = new DOMParser();
8 var doc = parser.parseFromString(html, 'text/html');
9
10 // Get the image file
11 var img = doc.querySelector('img');
12 console.log(img);
13
14}).catch(function (err) {
15 // There was an error
16 console.warn('Something went wrong.', err);
17});
18