Edition: 2nd
Book Title: 《You Don't Know JS Yet: Get Started - 2nd Edition》
Chapter: Chapter 2: Surveying JS
Section Title: ES Modules
Question:
To avoid ambiguity, use classic modules to support the multiple-instantiation scenario within ES Modules. Shouldn't the example in the documentation be consistent with the "Classic Modules" section above? Specifically:
- The function name should start with a capital letter.
- The function returns an "instance" of the module and exposes one or more functions that can operate on the module instance's internal (hidden) data.