promise1 Java Script - Promise, Async, Await, 포스트맨 서버 mock server Promise - ES6에서 추가된 기능이다. 서버에서 받은 결과가 다 나올 때 까지 다음 코드 실행을 멈추고 기다리게 한다. let url = ""; let data = axios.get(url).then(function(response){ console.log(response.data); return response.data; }); let total = 0; for (let tool of data){ total += tool.price; } console.log(total); src는 axios를 사용할 수 있도록 불러오는 코드이다. https://github.com/axios/axios GitHub - axios/axios: Promise based HTTP client for the browse.. 2022. 12. 12. 이전 1 다음