View on GitHub

reading-notes

Graphs

LINKS

ES6 Syntax and Feature Overview

ES6 introduced the let keyword, which allows for block-scoped variables which cannot be hoisted or redeclared.

ES6 introduced the const keyword, which cannot be redeclared or reassigned, but is not immutable.

The arrow function expression syntax is a shorter way of creating a function expression. Arrow functions do not have their own this, do not have prototypes, cannot be used for constructors, and should not be used as object methods.

function func(a, b, c) {} // function declaration
var func = function (a, b, c) {} // function expression

let func = (a) => {} // parentheses optional with one parameter
let func = (a, b, c) => {} // parentheses required with multiple parameters

Back to Homepage