Curriculum
Course: JavaScript Basic
Login

Curriculum

JavaScript Basic

JSHome

0/216
Text lesson

JS 2016

JavaScript Version Numbers

Earlier ECMAScript versions were named by numbers, such as ES5 and ES6. Starting in 2016, versions are named by the year of release, like ES2016, ES2018, ES2020, and so on.

New Features in ECMAScript 2016

This chapter covers the new features introduced in ECMAScript 2016:

  • JavaScript Exponentiation (**)
  • JavaScript Exponentiation Assignment (**=)
  • JavaScript Array includes() method

Browser Support

Since March 2017, ES2016 has been fully supported in all modern browsers.

js 6

ES2016 is not supported in Internet Explorer.

Exponentiation Operator

The exponentiation operator (**) raises the first operand to the power of the second operand.

Example

let x = 5;
let z = x ** 2;

x ** y produces the same result as Math.pow(x, y).

Example

let x = 5;
let z = Math.pow(x,2);

Exponentiation Assignment

The exponentiation assignment operator (**=) raises the value of a variable to the power of the right-hand operand.

Example

let x = 5;
x **= 2;

The Exponentiation Operator has been supported in all modern browsers since March 2017.

js 7

JavaScript Array includes()

ECMAScript 2016 introduced the Array.includes() method, which allows us to check if an element exists in an array.

Example

const fruits = [“Banana”“Orange”“Apple”“Mango”];

fruits.includes(“Mango”);

The Array.includes() method has been supported in all modern browsers since August 2016.

js 8