Uploaded July 2015 | Updated September 2026, 1 week ago
The revealing module pattern allows us to create private variables in a Javascript Module.
Here's a writeup on this pattern:
addyosmani.com/resources/essentialjsdesignpatterns/book/#revealingmodulepatternjavascript
Here's the code for this video:
codepen.io/anon/pen/ZGoKYN?editors=101
Here's video 1 in case you missed it:
youtube.com/watch?v=HkFlM73G-hk&index=18&list=PLoYCgNOIyGACnrXwo5HMCfOH9VT05znGv
We write a revealing module pattern by starting with a self-executing anonymous function also known as an IIFE (immediately invoked function expression).
This runs a function and sets it's return value as our module's value. If we return an object of methods, then those methods are what other modules have "public" access to. What's nice about this, is we can create any variables within the function and no other modules have access to them unless we expose them via our return object.
Modular JS #1 - Object Literal Pattern pt 1:
youtube.com/watch?v=HkFlM73G-hk&index=1&list=PLoYCgNOIyGABs-wDaaxChu82q_xQgUb4f
Modular JS #2 - Object Literal Pattern pt 2:
youtube.com/watch?v=m-NYyst_tiY&index=2&list=PLoYCgNOIyGABs-wDaaxChu82q_xQgUb4f
Modular JS #3 - Revealing Module Pattern:
youtube.com/watch?v=pOfwp6VlnlM&index=3&list=PLoYCgNOIyGABs-wDaaxChu82q_xQgUb4f
-~-~~-~~~-~~-~-
Also watch: "Responsive Design Tutorial - Tips for making web sites look great on any device"
youtube.com/watch?v=fgOO9YUFlGI
-~-~~-~~~-~~-~-
The revealing module pattern allows us to create private variables in a Javascript Module.
Here's a writeup on this pattern:
addyosmani.com/resources/essentialjsdesignpatterns/book/#revealingmodulepatternjavascript
Here's the code for this video:
codepen.io/anon/pen/ZGoKYN?editors=101
Here's video 1 in case you missed it:
youtube.com/watch?v=HkFlM73G-hk&index=18&list=PLoYCgNOIyGACnrXwo5HMCfOH9VT05znGv
We write a revealing module pattern by starting with a self-executing anonymous function also known as an IIFE (immediately invoked function expression).
This runs a function and sets it's return value as our module's value. If we return an object of methods, then those methods are what other modules have "public" access to. What's nice about this, is we can create any variables within the function and no other modules have access to them unless we expose them via our return object.
Modular JS #1 - Object Literal Pattern pt 1:
youtube.com/watch?v=HkFlM73G-hk&index=1&list=PLoYCgNOIyGABs-wDaaxChu82q_xQgUb4f
Modular JS #2 - Object Literal Pattern pt 2:
youtube.com/watch?v=m-NYyst_tiY&index=2&list=PLoYCgNOIyGABs-wDaaxChu82q_xQgUb4f
Modular JS #3 - Revealing Module Pattern:
youtube.com/watch?v=pOfwp6VlnlM&index=3&list=PLoYCgNOIyGABs-wDaaxChu82q_xQgUb4f
-~-~~-~~~-~~-~-
Also watch: "Responsive Design Tutorial - Tips for making web sites look great on any device"
youtube.com/watch?v=fgOO9YUFlGI
-~-~~-~~~-~~-~-





![[April Fools 2017] ES2018 First Look - it changes everything
ES2018 a.k.a. ESSuper-Next is out and it is awesome.
It has powerful new features like
always-global-variables,
common-keyword shortcuts,
dot-syntax,
flow/typescript support
Its sure to be a game-changer.
Oh...and by the way, this is an April Fools video :)
-~-~~-~~~-~~-~-
Also watch: Tailwind CSS - why CSS utility classes save so much time
https://www.youtube.com/watch?v=oU5ar0dmQEY
-~-~~-~~~-~~-~- [April Fools 2017] ES2018 First Look - it changes everything](https://i.ytimg.com/vi/s-G_RZ4RJLU/mqdefault.jpg)




