Let's say I have a variable that I want to export. What's the difference between
export const a = 1;
vs
export let a = 1;
I understand the difference between const
and let
, but when you export them, what are the differences?
This question is related to
javascript
ecmascript-6
es6-modules
I think that once you've imported it, the behaviour is the same (in the place your variable will be used outside source file).
The only difference would be if you try to reassign it before the end of this very file.
Source: Stackoverflow.com