async function one() {fetch('https://api.github.com/repos/javascript-tutorial/en.javascript.info/commits')
.then(res => res.json())
.then(data => {
test = data;
});
}
console.log(one())
Promise { undefined }
.async function one() {fetch('https://api.github.com/repos/javascript-tutorial/en.javascript.info/commits')
.then(res => res.json())
.then(data => { console.log(data) });
}
console.log(one())
function one() {
return fetch(
"https://api.github.com/repos/javascript-tutorial/en.javascript.info/commits"
)
.then((res) => res.json())
.then((data) => data);
}
one().then(console.log);