모듈 시스템(export/import)이 가능해짐. 모듈이 없을 때 // src/app.js console.log(sum(1, 2)); // src/math.js function sum(a, b) { return a + b; } * 위와 같이 사용하게 되면, - math.js와 app.js가 전역으로 선언되어 있음. - sum을 다른 변수로 사용할수 없음. - 이렇게 사용하는 경우전역 scope가 오염됨. IIFE방식의 모듈 math 전역변수 생성 - 전역 변수인 math 객체를 선언하고, math를 통해서만 sum에 접근할 수 있게 함. // src/math.js // 전역 name space 할당 var math = math || {}; (function () { //이 안의 scope는 외부로부터 ..
axios 가장 많이 사용되고 있는 자바스크립트 HTTP 클라이언트. Http요청을 Promise 기반으로 처리 yarn add axios axios GET 파라미터로 전달된 주소에 GET요청. .then을 사용하거나 async/await를 통해 리턴받은 데이터 확인 const getData = () => { axios.get(url) .then(response =>{ return response; }) } const getData = async () => { return await axios.get(url) } axios POST 첫번째 파라미터에 URL 주소, 두번쨰 파라미터에 request data를 넣고 api 호출 const postData = async (postParam) => { retur..
- Total
- Today
- Yesterday
- JSON
- ajax
- html
- JSX
- javascript
- paging
- java
- Redux
- Props
- value
- 클래스형
- input
- script
- 리액트
- 스프링
- Progressbar
- 함수형
- hashmap
- angular
- React
- webpack
- list
- date
- hooks
- typescript
- module
- nodeJS
- Spring
- JSP
- datePicker
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | ||||||
2 | 3 | 4 | 5 | 6 | 7 | 8 |
9 | 10 | 11 | 12 | 13 | 14 | 15 |
16 | 17 | 18 | 19 | 20 | 21 | 22 |
23 | 24 | 25 | 26 | 27 | 28 |