<aside> 💡

모듈간의 코드를 재사용하도록 하는 문법

</aside>

문법


  1. script 태그에 type = “module” 삽입하기
  2. export
export const bread = ["메론빵","소금빵"]
export const add = (a,b) => a+b;
  1. import
    1. ctrl + space 자동 수입
import {변수, 함수} from "./파일.js"