Javascript ES6 export const vs export let
问题 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? 回答1: In ES6, import s are live read-only views on exported-values. As a result, when you do import a from "somemodule"; , you cannot assign to a no matter how you declare a in the module. However, since imported variables are live views, they do change according to the