ES Module 에 대하여
ES Module의 Named Export, Default Export, Star Export 방식과 최적화 방법을 자세히 설명합니다.
- Named Export export 된 이름과 import 된 이름이 항상 같아야 함.
 
export const plus = (a, b) => a+b;
export const minus = (a, b) => a-b;
...
import { plus, minus as subtract } from "./math"
- Default Export 한 파일에는 하나의 Default Export 가 가능하다. 원하는 이름으로 import 가능하다.
 
const plus = (a, b) => a+b;
const minus = (a, b) => a-b;
export default { plus, minus }
...
import myMath from "./math";
myMath.plus(1, 1);
- Star Export 모든 구성요소들이 *에 객체 형식으로 export 되게 된다. ```javascript
 
export const plus = (a, b) => a+b; export const minus = (a, b) => a-b; …
import * as myMath from "./math"; myMath.plus(1, 1);
<br />
***
<br />
* 최적화 
    * Named Export 를 사용하는 것이, 최적화 부분에서는 더 우월하다.
    * Dyanmic Import 를 사용하면, 최적화 할 수 있다. 
javascript function doMath() { const math = await import("./math"); return math.plus(1, 1); } btn.addEventListener("click", doMath); ```
이것도 읽어보세요