Chapter 2 : Emerging JavaScript

If you haven't made the switch to the latest JavaScript syntax yet, now is a good time to get started.

Samples

Declaring Variables in ES6

const

  1. Without const (run it)

  2. With const ❌ (run it)

let

  1. Without let (run it)

  2. With let (run it)

  3. Loops with var (run it)

  4. Loops with let (run it)

template strings

  1. Without Template Strings - Simple Concatenation (run it)

  2. With Template Strings - Simple concatenation (run it)

  3. Template Strings - Email (run it)

  4. Template Strings - HTML (run it)

Default Parameters

  1. Default Parameters (run it)

  2. Default Parameters with Objects (run it)

Arrow functions

  1. Regular Function (run it)

  2. Arrow Function (run it)

  3. Arrow Function - Multiple Args (run it)

  4. Multiple Args - One Line (run it)

  5. Arrow Functions with if statements ❌ (run it)

  6. Arrow Functions with errors ❌ (run it)

  7. setTimeout ❌ (run it)

  8. setTimeout with .bind (run it)

  9. setTimeout with Arrow Function (run it)

  10. setTimeout with 'this' problem ❌ (run it)

  11. Showing 'this' problem (run it)

Objects and Arrays

Destructuring Assignment

  1. Destructuring Assignment (run it)

  2. Destructuring with Arguments (run it)

  3. Destructured Object Arguments (run it)

  4. Destructuring Arrays (run it)

  5. Destructuring with Comma Placeholders (run it)

Object Literal Enhancement

  1. Object Literal Enhancement (demo, code, bin)

  2. Object Literal Enhancements with Functions (demo, code, bin)

  3. Literal Enhancements: The Old Way (demo, code, bin)

  4. Literal Enhancements Now (demo, code, bin)

The Spread Operator

  1. Spread Operator with Arrays (run it)

  2. Array Destructuring with .reverse() (run it)

  3. Spread Operator with Destructuring and .reverse() (run it)

  4. Destructuring and the Spread Operator (run it)

  5. Directions Functions (run it)

  6. Spread Operator with Objects (run it)

Promises

  1. getFakeMembers (run it)

  2. fetch members (run it)

ES6 Class Syntax

  1. The Constructor and the Prototype (run it)

  2. Classes (run it)

  3. Class Inheritance (run it)

Last updated