[NodeJS] fetch 함수
fetch 함수 실행 console.log('START!'); fetch('https://jsonplaceholder.typicode.com/users') .then((response) => response.text()) .then((result) => {console.log(result); }) console.log('END'); 결과 START! END [ { "id": 1, ... → response 내용이 END 보다 늦게 출력 됨 처음 START 출력 request 보냄. then 메소드는 callback 함수를 등록할 뿐, 실행하지 않음. 그리고 다음 End 출력 서버로부터 response가 도착하고, then 메소드로 등록된 callback들이 실행됨(비동기 실행). 동기 실행: 한 번 시작..