必须返回
2
从那开始
.then()
处理程序,使其成为下一个
。然后()
function getHubspotData(url) {
console.log("URL: " + url);
return fetch(url)
.then((resp) => resp.json()) // Transform the data into json
.then(function(data) {
console.log(data);
return 2; // set resolved value of promise
}).then(function (x) {
console.log(x); // outputs 2
});
}