An extensive list of everyday modern JavaScript with syntactical ES5 / ES6 examples
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
arrays
async
design-patterns
essential-javascript
functions
modules
objects
.gitignore
CODE-OF-CONDUCT.md
LICENSE
README.md

README.md

Modern JavaScript

An extensive list of everyday modern JavaScript with syntactical examples as well as an easy to follow README structure

Introduction

This repository is a place for pragmatic javascript developers (beginners to advanced) to view and familiarize themselves with modern everyday patterns and idioms in vanilla style ES5 & ES6. The great majority of syntax found here is very useful and common in the modern world of JavaScript. Note, there are no silver bullets, so please don't try and force your problem to fit a pattern or tool.

I hope you find that this repo will help you to quickly recognize even the trivial of syntax and therefore be able to apply it in your situation - most of all I hope you find invaluable inspiration and satisfaction as you work through the examples. For novices, you'll gain the most if you revisit them after you've gained some experience.

Listed within this repository is not only syntax but patterns and other useful concepts as well:

  • Essential Code Syntax & Guidelines
  • Design Patterns
  • Modern Functional Patterns / Concepts
  • ES6 / ES7
  • Async

...note that the work here has been identified by the JavaScript community as well as within the authors own work. Thanks should be given to the developers, early adopters, JavaScript technocrats, and technology pundits that came before us outlining important and often misunderstood concepts.

Table of Contents

  1. ESSENTIAL JAVASCRIPT
    1.1 Variable Declaration
    1.2 let & const
    1.3 Global Variables
    1.4 Coding & Naming Conventions
    1.5 Commas, Comments, Semicolons & Whitespace
    1.6 Strings
    1.7 Implicit Coercion
    1.8 Iteration Statements / Loops
    1.9 Block Scope vs Lexical Scope
    1.10 Conditionals

  2. CORE JS OBJECT CREATION & CORE DESIGN PATTERNS
    2.1 Object Creation
    2.2 Object.create
    2.3 Object Enumeration
    2.4 Object Cloning
    2.5 Object Factory Pattern
    2.6 NameSpace Pattern
    2.7 Module Pattern
    2.8 Chaining Pattern
    2.9 Constructor Function Pattern
    2.10 Prototype Pattern
    2.11 Class Pattern

  3. JAVASCRIPT DESIGN PATTERNS
    3.1 Singleton Pattern
    3.2 Iterator Pattern
    3.3 Pub/Sub Pattern
    3.4 Observer Pattern
    3.5 Decorator Pattern
    3.6 Facade Pattern

  4. ARRAYS
    4.1 Array Basics & Creation
    4.2 Array Iteration
    4.3 ES6 Array Methods
    4.4 Destructuring
    4.5 Spread & Rest
    4.6 Functional Array Patterns

  5. FUNCTIONS
    5.1 IIFE / IIAF
    5.2 Immediate Object Initialization
    5.3 Function Invocation
    5.4 Returning from Functions
    5.5 Callbacks
    5.6 Closures
    5.7 Higher Order Functions
    5.8 Arrow Functions
    5.9 Partial Application
    5.10 The this Keyword

  6. ASYNC PATTERNS
    6.1 Callbacks in Depth
    6.2 Promises
    6.3 Async Generators
    6.4 Async Functions

  7. MODULE CREATION
    7.1 Node & NPM
    7.2 ES6
    7.3 Babel

  8. MODERN JAVASCRIPT
    8.2 Higher Order Functions
    8.2 Imperative vs. Declarative Programming
    8.3 Higher Order Functions
    8.4 Functional Programming
    8.5 Pure Functions, Impure Functions and Side Effects
    8.6 Stateful and Stateless
    8.7 Immutability and Mutability

  9. ES6 PATTERNS
    9.1 Arrow Functions
    9.2 Rest
    9.3 Destructuring
    9.4 Array Spreads
    9.5 Iterators and Generators
    9.6 Default Parameters

Future of This Project

In future releases we will also cover Angular (2.x) and React patterns. The formula for adding patterns will be determinedby libraries / frameworks that hold the most market value. Once this repository contains enough information I'd like it to be converted into a full blown application so developers can cover a great deal and retain information in short, but more meaningful bursts.

Publishing

When time permits, there will be a version out on Leanpub or Gitbook - it's too early to tell at this point, but the skies the limit.

Training & Speaking

If you or your team of developers need hands on training regarding the material covered in this course please reach out to me: ahadb.com

Resources

Blogs

Books

Contributing

Feel free to contribute to this repository by sending a PR for a specific pattern that you would like to see added. A guide will be put up shortly.