Skip to content

Commit ca94721

Browse files
committed
different styles of export and imports
1 parent 2c8ba4e commit ca94721

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

server/calculatorEs6.mjs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,3 +7,5 @@ function multiply(a, b) {
77
}
88

99
export { add, multiply };
10+
11+
export default multiply;

server/indexEs6.mjs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,11 @@
11
import * as calculator from './calculatorEs6.mjs';
22

3+
import { add } from './calculatorEs6.mjs';
4+
5+
import defaultExportedFunction from './calculatorEs6.mjs';
6+
37
console.log(calculator.add(12, 3));
8+
9+
console.log(add(12, 3));
10+
11+
console.log(defaultExportedFunction(12, 3));

0 commit comments

Comments
 (0)