Introduction to

ahmedgmurtaza

slides.com/ahmedmurtaza

codepen.io/ahmedgmurtaza

codesandbox.io/u/Ahmedgmurtaza

Ahmed Murtaza

@ahmedgmurtaza

Table of content

  • Constants
  • Scoping
  • Arrow function
  • Template literal
  • Rest parameter & Spread operator
  • Modules
  • Classes

{ }

Constants

  • also known as immutable variables
  • content can be modified in case of Objects and Arrays

Constants with primitive data types​​

Constants

Primitive data types

Constants with object & Arrays

Constants

Object

Array

Scoping

  • hoisting does not subject for let & const declarations
  • Block scoped variables
  • Block scoped functions

Block scoped variables

{  }

Scoping

Block scoped variables

Block scoped functions

Scoping

Block scoped functions

ES6

ES5

Arrow function

Expression & statement body

=>

Arrow function

lexical this

Expression

Statement

Arrow function

lexical 'this'

Template Literals

${`Hi!`}

New

Old

Rest parameter

...args

Spread operator

aggregating arguments in single parameter

Spread operator

[...args]

iterable collection of elements

Modules

Classes

inheritance

Classes

Inheritance

Tools

Babeljs

use it to compile next generation javascript code

Thank you

Introduction to ES6

By Ahmed Murtaza

Introduction to ES6

Brief introduction to ES6 features including Classes, Modules, Rest parameter, Spread operator, constants, lexical this, arrow function, block scope variables, block scoped functions and template literals.

  • 390