JS TutorialLesson #147

ECMAScript 2016

Supported in all modern browsers since March 2017.

New Features in JavaScript 2016

Supported in all modern browsers since March 2017.

FeatureDescription
**Raises the first operand to the power of the second
**=Raises the value of a variable to the power of the right operand
Array includes()Checks if an element is present in an array

Browser Support

JavaScript 2016 is supported in all modern browsers since March 2017:

Chrome 52Edge 15Firefox 52Safari 10.1Opera 39
Jul 2016Apr 2017Mar 2017May 2017Aug 2016

ES 2016 is not supported in Internet Explorer.


Exponentiation Operator

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

Example

Example Code

javascript
Try it Yourself
let x = 5;

let z = x ** 2;

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

Example

Example Code

javascript
Try it Yourself
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 operand.

Example

Example Code

javascript
Try it Yourself
let x = 5;

x **= 2;

JavaScript Array includes()

ECMAScript 2016 introduced Array.includes to arrays.

This allows us to check if an element is present in an array:

Example

Example Code

javascript
Try it Yourself
const fruits = ["Banana", "Orange", "Apple", "Mango"];

fruits.includes("Mango");

Interactive Code Examples

JS Example 1

javascript
Try it Yourself
JavaScript syntax and algorithm demonstration.
let x = 5;

let z = x ** 2;

JS Example 2

javascript
Try it Yourself
JavaScript syntax and algorithm demonstration.
let x = 5;

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

JS Example 3

javascript
Try it Yourself
JavaScript syntax and algorithm demonstration.
let x = 5;

x **= 2;

JS Example 4

javascript
Try it Yourself
JavaScript syntax and algorithm demonstration.
const fruits = ["Banana", "Orange", "Apple", "Mango"];


fruits.includes("Mango");