Modular Javascript #3 - Revealing Module Pattern Javascript Tutorial

preview_player
Показать описание
The revealing module pattern allows us to create private variables in a Javascript Module.
Here's a writeup on this pattern:
Here's the code for this video:
Here's video 1 in case you missed it:

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:

Modular JS #2 - Object Literal Pattern pt 2:

Modular JS #3 - Revealing Module Pattern:

-~-~~-~~~-~~-~-
Also watch: "Responsive Design Tutorial - Tips for making web sites look great on any device"
-~-~~-~~~-~~-~-
Рекомендации по теме
Комментарии
Автор

Another banger!! This is next level JS lecturing on the entire Youtube universe. First time I have seen teaching this clear. Great lesson

SimPwear
Автор

This IIFE's syntax with the wrapping parenthesis was driving me crazy, I just resignated to "It's the way it is" bcs I didn't know what it was about. But this video was like a holy illumination of comprehensiveness. Thanks a lot for those re-recorded sessions, it's peak content.

diegomaterano
Автор

I just loved your explanation for how self executing anonymous function works.

ShrinivasKattimani
Автор

I've been developing business applications in various languages for over 30 years, using JavaScript for over 10 years, but only really trying to do large applications with JavaScript for the last three years. This was the single best explanation of an IIFE I have ever come across. This is a great series...thank you!

NeilTruick
Автор

This is going to sky rocket my javascript architecture, thankyou very much sir 🙏🙏

mayank_upadhyay_
Автор

This series is a treasure for humanity!!! Thank you so much for your hard work.

mahdisalah
Автор

this is gold. I am lucky to found this series. really sad to see so less views.

masibhai
Автор

Just wanted to thank you for putting these videos together. I had been "taught" how to program with the "crap" you described in your first video and it was always annoying and hard to deal with. Going over these patterns is very refreshing so thank you for taking the time to put together the examples and resources.

Jessyco
Автор

What a good explanation of IIFE. I never thought about it in that way, "Evaluating expression". Keep up with these awesome videos

junedchhipa
Автор

Thank you Will for introducing me to JS world. It was in 2016, but I still remember how much fun it was <3

marioua
Автор

Hey Will this video series is brilliant!!! This is what i have been waiting for, for ages!!! There are so many beginner and advanced tuts out there but this is such an amazing learning tool to get you to that next level where you are actually building an app instead of just coding lots of little functions that may work like an app does but is not professional or efficient in any way!! 

THanks so much dude keep up the kick ass work!!!

GifCoDigital
Автор

This is actually some gold. My teacher is well....

howchen
Автор

OMG.. Where were this videos!!.. Why YouTube haven't recommended this to me.. Thanks a lot.. You're damn good

rajagopalcr
Автор

Explanation of 1.toString( ) is very useful for beginners.

harunguven
Автор

Thank you so much Will! I have used other sources of learning like treehouse and code academy and neither of them really explained how this transition worked (theyve just jumped straight into it almost like it is a seperate entity) and why to code this way. Now I truly understand how scope and OOP works in JS. What a great explanation and walk through! From now on I will be THINKING and writing my code this way. Thank you again and please keep making awesome videos!

thegrid-g
Автор

Your explanation to IIFE was so simple.

itsimpl
Автор

Awesome video. Been working with javascript a lot (only smaller scripts). But lately my projects are growing a lot. Knew about this pattern, just never really sat down learning it. Nice quick introduction.

joshuaryder
Автор

I'm loving this series! Keep up the good work.

DanieleTrapani
Автор

Wow what a great explanation for anonymous function. thanks i now know what is anonymous function

javascript_developer
Автор

I just love you man. Your method of conveying principals is amazing

elieghossein