전체 페이지의 새로고침없이도 URl(서버)로부터 데이터를 받아올 수 있다.
fetch('https://jsonplaceholder.typicode.com/todos/1') //호출할 URL
.then(response => response.json())
.then(json => console.log(json))
자바스크립트 객체
로 변환한다JSON으로 서버와 통신한다 💬
JSON.stringify() - 서버로 데이터를 보낼 때
ㄴ js객체를 → json으로 변환 (typeof string)
JSON.parse() - 서버에서 데이터를 가져올때
ㄴ json → js객체로 변환