ES7 Features, TIME to update your JavaScript/ES6

By | April 20, 2020

See the ES2016 (ES7) standard for full specification of the ECMAScript 2016 language. Practical Learning of New JavaScript Features.


includes the following new features of es 7:

Exponentiation Operator

Performs exponential calculation on operands. Same algorithm as Math.pow(x, y)

See the Pen ES7 Features – Exponentiation Operator by Vimalraj (@w3tweaks) on CodePen.

Async functions

Deferred Functions. Find the code below

See the Pen ES7 – Async functions by Vimalraj (@w3tweaks) on CodePen.

Async generators

Deferred generators.

// provider
async function* nums() {
  yield 1;
  yield 2;
  yield 3;

// consumer
async function printData() {
  for(var x on nums()) {


Returns a property descriptor for an own property.

// Creating a shallow copy.
var shallowCopy = Object.create(


Get all the values of the object as an array.

var person = { fname: "Hemanth", lname: "HM", location: "Earth", type: "Human" };


//^ ["Hemanth","HM","Earth","Human"]


Returns a Array of arrays of key,value pairs.

var person = { fname: "Hemanth", lname: "HM", location: "Earth", type: "Human" };


//^ [["fname","Hemanth"],["lname","HM"],["location","Earth"],["type","Human"]]


Determines whether an array includes a certain element or not.

[1, 2, 3].includes(3, 0, 7); // true
[1, 2, NaN].includes(NaN); // true
[0,+1,-1].includes(42); // false

Typed Objects

Portable, memory-safe, efficient, and structured access to contiguously allocated data.

var Point = new StructType({
  x: int32,
  y: int32

var point = new Point({
  x: 42,
  y: 420

Trailing commas in function syntax.

Trailing commas in parameter and argument lists.

var meow = function (cat1, cat2,) {}


Class decorators.

Annotate and modify classes and properties at design time.

class Person {
  get kidCount() { return this.children.length; }

function cantEnum(target, name, descriptor) {
  descriptor.enumerable = false;
  return descriptor;

Class properties

Properties of class.

class Cat {
  name = 'Garfield';
  static says = 'meow';
new Cat().name; // Garfield
Cat.says; // meow


toJSON for Maps.

var myMap = new Map();
myMap.set(NaN, "not a number");

console.log(myMap.toJSON()); // {"NaN":"not a number"}


toJSON for Sets.

var mySet = new Set();
console.log(mySet.toJSON()) // {"1":1,"NaN":null}

String containing the code point at the given position

'abc\uD834\uDF06def'.at(1) // 'b'
'abc\uD834\uDF06def'.at(3) // '\uD834\uDF06'

Object rest properties

Rest properties for object destructuring assignment.

let { fname, lname, } = { fname: "Hemanth", lname: "HM", location: "Earth", type: "Human" };
fname; //"Hemanth"
lname; //"HM"
rest; // {location: "Earth", type: "Human"}

Object spread properties

Spread properties for object destructuring assignment.

let info = {fname, lname,};

info; // { fname: "Hemanth", lname: "HM", location: "Earth", type: "Human" }


left justify and pad strings.

"hello".padLeft(4)            #=> "hello"
"hello".padLeft(20)           #=> "hello               "
"hello".padLeft(20, '1234')   #=> "hello123412341234123"


right justify and pad strings.

"hello".padRight(4)            #=> "hello"
"hello".padRight(20)           #=> "               hello"
"hello".padRight(20, '1234')   #=> "123412341234123hello"


left trims the string.

' \t \n LeftTrim   \t\n'.trimLeft(); // 'LeftTrim   \t\n';


right trims the string.

' \t \n RightTrim   \t\n'.trimRight(); // ' \t \n RightTrim';


Escapes any characters that would have special meaning in a regular expression.

RegExp.escape("(*.*)"); // "\(\*\.\*\)"
RegExp.escape("。^・ェ・^。") // "。\^・ェ・\^。"
RegExp.escape("😊 *_* +_+ ... 👍"); // "😊 \*_\* \+_\+ \.\.\. 👍"

Bind Operator

:: Function binding and method extraction

let log = (level, msg) => ::console[level](msg);

import { map, takeWhile, forEach } from "iterlib";

  ::map(x => x.character())
  ::takeWhile(x => x.strength > 100)
  ::forEach(x => console.log(x));

Author: ven

Reference: Link

Author: CV

I am a Front-end Developer, graduate of Information Technology, and founder of I have 12+ years commercial experience providing front-end development, producing high quality responsive websites and exceptional user experience.