Tag: ECMA 6

Javascript

ES6 Generators

A Generator can be used as the iterator object of another object to comply with Iteration Protocols. It can be defined using function* and yield as shown belowAs an iterator of an object It is possibl

Javascript

ES6 Iteration Protocols

ES6 defines two protocols for iteration. Iterable Protocol Iterator Protocol Iterable Protocol Iteration can be done in an object if it is iterable by implementing @@iterator using Symbol.iterato

Javascript

ES6 Module

ES6 has built-in support for modules. Code can be divided into multiple modules and can be managed using export and import statements. RequirementsTo run the example given below NodeJS environment has

Javascript

ES6 Symbol

Symbol is a new primitive data type introduced in ES6. It is unique and immutable, and can be created using the function Symbol. It can be used as unique keys in objects. See the example below Gl

Javascript

ES6 Proxy

In ES6 a proxy can be created for an object, and the operations of that object can be intercepted.

Javascript

ES6 Promise

Promoise is for asynchronous programming. Javascript is the language for the client side of web and in most of the cases the execution of the program waits for the completion of an asynchronous reques

Javascript

ES6 Data Structures

ES6 adds two useful and efficient data structures, Set and Map. SetSet is a collection of unique values of any type. It can be initialized empty or with an existing list of items. MapMap is key-valu

Javascript

ES6 Miscellaneous

There are many new keywords in ES6. Some of them are listed below with examples. letThe keyword let can be used to bind variable to a scope. It is different from var because let defines a variable in

Javascript

ES6 Function Parameters

In ES6 there are multiple enhancements in defining function parameters - default, rest and spread. DefaultYou can set a default value for a function parameter. RestFirst parameter of a function can