ES7 APIs & Features

ES7 (ECMAScript 2016) introduced the exponentiation operator and Array.prototype.includes method, providing more convenient ways to work with numbers and arrays.

Released: June 2016
Modern JavaScript
ECMAScript

Other JavaScript Versions

Release Information

Release Date:

June 2016

Version Type:
Modern

Quick Summary

ES7 (ECMAScript 2016) introduced the exponentiation operator and Array.prototype.includes method, providing more convenient ways to work with numbers and arrays.

Top Features

  • Exponentiation Operator (**)
  • Array.prototype.includes
  • Array.prototype.findIndex

Playground

Try out JavaScript code examples and experiment with features in the official TypeScript playground.

Open JavaScript Playground

API Examples

Exponentiation Operator (**)

Raises the left operand to the power of the right operand.

const result = 2 ** 3; // 8
const square = 5 ** 2; // 25

// Equivalent to Math.pow
const same = Math.pow(2, 3); // 8

Array.prototype.includes

Determines whether an array includes a certain value among its entries.

const numbers = [1, 2, 3, 4, 5];
console.log(numbers.includes(3)); // true
console.log(numbers.includes(6)); // false

// With start index
console.log(numbers.includes(2, 2)); // false (starts from index 2)