ES Update

 

A Wee Catch Up On the Language

you Thought you Knew

 

Let's Begin! (Space or Arrow Keys to Navigate)

Block Scoped Variables

JavaScript Joins the ranks of other languages with block scoping

let and const

New keywords for declaring block-scoped mutable and immutable variables

Arrow Functions

A concise way to define function expressions

Arrow Functions - this Binding

this is a notoriously cryptic keyword in JavaScript

Arrow functions provide a more predictable behaviour for this

Destructuring Assignment

Destructuring lets us describe the structure of data while simultaneously assigning names to its members

It reduces the surface area for bugs, encourages immutable flows, and reduces boilerplate when defining functions

Destructuring Assignment - Arrays

Destructuring Assignment - Objects

Destructuring Assignment - Aliasing

Destructuring Assignment - Function Params

Rest and Spread

Rest and Spread - Tricks

Default Parameters

Concise Object Syntax

When initializing objects, if you have a variable with the same name as one of your keys, you can skip the assignment

Computed Object Keys

Prior to ES2015, we couldn't initialize a new object with dynamic keys

Template Literals

class Keyword

Let's get one thing very clear: JavaScript does not have classes - Not then, and not now. The class keyword simply helps us write object constructors with their prototype methods more concisely

Promises

A promise is a container (monad) for a future value. You can unwrap the value with the then method, or the error state with the catch method

async Functions

Syntactic sugar for promise flows that makes async code look sync

Async functions always return promises, and any errors thrown will reject the promise

Thanks For

Watching!

Read More

Benny Powers Github profile Gitlab profile