Skip to main content

JavaScript ES Versions


What is ES?

ECMAScript is a JavaScript standard meant to ensure the interoperability of web pages across different web browsers. It is standardised by Ecma International according to the document ECMA-262.

ECMAScript is commonly used for client-side scripting on the World Wide Web, and it is increasingly being used for writing server applications and services using Node.js.

ES5 (2009) some important features

  1. USE STRICT DIRECTIVE
'use strict'
v = 10 // u will get an error v is not defined.
  1. NEW METHODS IN AN ARRAY

isArray(), forEach(),map(),filter(),reduce(),reduceRight(),every(),some(),indexOf(),lastIndexOf()

  1. JSON SUPPORT

parse() stringify()

  1. NEW METHODS IN A DATE

now() valueOf()

  1. GETTERS AND SETTERS

The get method returns the value of a variable, and the set method sets the value of the variable.

  1. PROPERTY METHODS

Object.defineProperty(): This method lets the user define the property of an object and/or change its value.

ES6 (2015) some important features

  1. LET & CONST
  2. FOR..OF
  3. DEFAULT PARAMETERS
  4. REST OPERATOR
  5. SPREAD OPERATOR
  6. DESTRUCTURING
  7. TEMPLATE LITERALS/STRINGS
  8. ARROW FUNCTIONS
  9. PROMISES
  10. CLASSES

ES7 (2016) some important features

  1. EXPONENTIATION OPERATOR()**

ES7 added an exponentiation operator (**) to already JavaScript supported arithmetic operations like +,-,*. This operator raises the first operand to the power second operand.

console.log(3**2) //3 to the power of 2 which is 9.
  1. INCLUDES

Returns true if an array includes a value, if not returns false.

var animals = ['cat','dog','lion','tiger']
console.log(animals.include('cat')) //return true

ES8 (2017) some important features

  1. PADSTART
  2. PADEND
  3. SYNC/AWAIT
  4. OBJECT.ENTRIES()
  5. TRAILING COMMAS
  6. SHARED MEMORY AND ATOMICS
  7. OBJECT.GETOWNPROPERTYDESCRIPTORS()
  8. OBJECT.VALUES()

ES9 (2018) some important features

  1. ASYNCHRONOUS ITERATION
  2. REGULAR EXPRESSION IMPROVEMENTS
  3. REST/SPREAD PROPERTIES
  4. PROMISE.PROTOTYPE.FINALLY()