Module Design Pattern – Beau teaches JavaScript

By | 31st July 2017
Module Design Pattern – Beau teaches JavaScript

The module design pattern in JavaScript is one of the most used designed pattern for keeping particular pieces of code independent from other parts. Learn how to use it in this quick video!

Code:
🔗 http://codepen.io/beaucarnes/pen/ygvoNM?editors=0010
More information:
🔗 https://joshbedo.github.io/JS-Design-Patterns/
🔗 http://www.2ality.com/2014/09/es6-modules-final.html

Beau Carnes on Twitter: https://twitter.com/carnesbeau

⭐JavaScript Playlists⭐
▶JavaScript Basics: https://www.youtube.com/playlist?list=PLWKjhJtqVAbk2qRZtWSzCIN38JC_NdhW5
▶ES6: https://www.youtube.com/playlist?list=PLWKjhJtqVAbljtmmeS0c-CEl2LdE-eR_F
▶Design Patterns: https://www.youtube.com/playlist?list=PLWKjhJtqVAbnZtkAI3BqcYxKnfWn_C704
▶Data Structures and Algorithms: https://www.youtube.com/playlist?list=PLWKjhJtqVAbkso-IbgiiP48n-O-JQA9PJ
▶Clean Code: https://www.youtube.com/playlist?list=PLWKjhJtqVAbkK24EaPurzMq0-kw5U9pJh


We’re busy people who learn to code, then practice by building projects for nonprofits. Learn Full-stack JavaScript, build a portfolio, and get great references with our open source community.

Join our community at https://freecodecamp.com
Follow us on twitter: https://twitter.com/freecodecamp
Like us on Facebook: https://www.facebook.com/freecodecamp
Follow Quincy on Quora: https://www.quora.com/Quincy-Larson
Video Rating: / 5

2 thoughts on “Module Design Pattern – Beau teaches JavaScript

  1. wjrasmussen666

    Do browsers support ES6? I thought is wasn't supported fully.

    Reply
  2. CodeTuts

    Without the syntax sugar and prototype orientation it'd look like:

    let Module = (() => {
    let private = 'secret'

    function _privFunc() { console.log('Ayy LMAO') }
    function publicFunc() { _privFunc() }

    return { publicFunc }
    }())

    Reply

Leave a Reply