함수 내보내기, 가져오기 관련
어떤 경우에 export default function으로 내보내고 import ~ from ‘./~’;로 가져오고
어떤 경우에 exports.함수명 , var http = require(“http”);로 가져오는 것일까?
commonJS 방식 : (exports / require )
ESM 방식 : ( import from / export / export default )
'Javascript' 카테고리의 다른 글
tree구조 데이터를 postorder traversal방식으로 javascript로 구현해보자 (0) | 2023.09.05 |
---|---|
타입스크립트 오류) error TS2584: Cannot find name 'console'. Do you need to change your target library? Try changing the 'lib' compiler option to include 'dom'. (0) | 2022.10.24 |
closure 클로저 (0) | 2022.10.18 |
this, (0) | 2022.10.18 |
HTTP request, response, CSR, SSR, FETCH API (1) | 2022.10.11 |