I am really confused about:
export const foo
export default foo
module.exports = foo;
I kno
The export statement is used to export functions, objects or primitives from a given file (or module).
Named Exports This is a named export in ES6 javascript
export const foo
which is imported like:
import { foo } from 'path'
Default Export This is a default export (This can be imported using any name)
export default foo
which is imported like so:
import bar from 'path'
This is commonjs export which is used in nodejs programs.
module.exports = foo;
which is imported like:
var foo = require('path')
For more details