January 2020
Intermediate to advanced
548 pages
13h 36m
English
The Conventional Module pattern is useful in any scenario where you simply wish to wrap up a set of related methods or properties into something with a common name. They are often used for collections of common methods that somehow relate to each other, such as logging utilities:
const logger = { log(message) { /* ... */ }, warn(message) { /* ... */ }, error(message) { /* ... */ }};
The Conventional Module pattern is just an object, so it's arguably unnecessary to even mention it at all. But, technically, it is an alternative to other techniques of abstraction definition, so it's useful to designate it as a pattern of its own.
Read now
Unlock full access