QuizNot attempted
Imported bindings are read-only
1–4 to choose, Enter to submit
Show answer & explanation
Correct answer:
- TypeError: assignment to a constant variable. Imports are read-only live bindings
- Imported bindings are read-only: assigning to
myCounterthrows TypeError ('Assignment to constant variable'), whether or not the exporter usedlet. - Not 'becomes 11 only in index.js': importers can't create a local copy by assigning.
- Not 'counter.js changes too': only the exporting module can change its own variables.
- Not 'works with a warning': module code is strict, so it throws.
- Named
export letbindings are live export default counterexports the value at that moment.