understanding fetch request and promises code example
Example 1: xml http request fetch
fetch('my/url/').then(respone()=>{
console.log(response);
}
Example 2: javascript fetch get data from promise
var x = fetch(SOME_URL, SOME_POST_DATA)
.then((response) => response.json())
.then((responseJSON) => {
// do stuff with responseJSON here...
console.log(responseJSON);
});