[javascript] ES6 모듈에서 default와 named export를 함께 사용하는 방법은 무엇인가요?

아래는 ES6 모듈에서 default와 named export를 함께 사용하는 간단한 예제입니다.

// 모듈 파일: myModule.js

// default export
export default function myFunction() {
  console.log('This is a default export');
}

// named export
export function myOtherFunction() {
  console.log('This is a named export');
}

이제 default와 named export를 함께 사용하여 모듈을 정의했습니다. 다른 파일에서 이 모듈을 가져와 사용하는 방법은 다음과 같습니다.

// 다른 파일에서 모듈 가져오기
import myFunction, { myOtherFunction } from './myModule.js';

// default export 사용
myFunction(); // 'This is a default export'

// named export 사용
myOtherFunction(); // 'This is a named export'

이렇게 함으로써 ES6 모듈에서 default와 named export를 함께 사용할 수 있습니다. 필요에 따라 default export와 named export를 조합하여 모듈을 유연하게 정의하고 사용할 수 있습니다.