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
- USE STRICT DIRECTIVE
'use strict'
v = 10 // u will get an error v is not defined.
- NEW METHODS IN AN ARRAY
isArray(), forEach(),map(),filter(),reduce(),reduceRight(),every(),some(),indexOf(),lastIndexOf()
- JSON SUPPORT
parse() stringify()
- NEW METHODS IN A DATE
now() valueOf()
- GETTERS AND SETTERS
The get method returns the value of a variable, and the set method sets the value of the variable.
- 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
- LET & CONST
- FOR..OF
- DEFAULT PARAMETERS
- REST OPERATOR
- SPREAD OPERATOR
- DESTRUCTURING
- TEMPLATE LITERALS/STRINGS
- ARROW FUNCTIONS
- PROMISES
- CLASSES
ES7 (2016) some important features
- 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.
- 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
- PADSTART
- PADEND
- SYNC/AWAIT
- OBJECT.ENTRIES()
- TRAILING COMMAS
- SHARED MEMORY AND ATOMICS
- OBJECT.GETOWNPROPERTYDESCRIPTORS()
- OBJECT.VALUES()
ES9 (2018) some important features
- ASYNCHRONOUS ITERATION
- REGULAR EXPRESSION IMPROVEMENTS
- REST/SPREAD PROPERTIES
- PROMISE.PROTOTYPE.FINALLY()