let response = fetch("https://jsonplaceholder.typicode.com/posts").then(
(res) => {
console.log(res);
}
);
❗ fetch를 통해서 API를 호출하게되면 API의 결과값을 그냥 반환하는게 아니라 API의 성공 객체 자체를 반환 (껍질에 싸여 있는 사탕)
async function getData() {
let rawresponse = await fetch("https://jsonplaceholder.typicode.com/posts");
let jsonresponse = await rawresponse.json();
console.log(jsonresponse);
}
getData();
❗ (껍질이 벗겨진 사탕)