What is the difference between a module’s live binding and a CommonJS exported value?

JavaScript Professional Hard

JavaScript Professional — Hard

What is the difference between a module’s live binding and a CommonJS exported value?

Key points

  • ES module imports are live read-only views
  • CommonJS require() creates a copy at require-time
  • ES modules reflect changes in the exporting module
  • CommonJS values are fixed at import time

Ready to go further?

Related questions