This example uses gojax/fetch library.
See the output in browser developer console.
Actual code:
fetch('https://httpbin.org/anything')
.then(function(res) {
return res.text();
}).then(function(txt) {
console.log(txt);
exitloop();
});