HTML tutorial
CSS3 tutorial
Bootstrap tutorial
JavaScript tutorial
JQuery tutorial
AngularJS tutorial
React tutorial
NodeJS tutorial
PHP tutorial
Python tutorial
Python3 tutorial
Django tutorial
Linux tutorial
Docker tutorial
Ruby tutorial
Java tutorial
C tutorial
C ++ tutorial
Perl tutorial
JSP tutorial
Lua tutorial
Scala tutorial
Go tutorial
ASP.NET tutorial
C # tutorial
Original JavaScript version numbers were ES5 (2009) and ES6 (2015)
This chapter introduces the new features in ECMAScript 2016:
The exponentiation operator (**
) raises the first operand to the power of the second operand.
let x = 5;
let z = x ** 2; // result is 25
x ** y
produces the same result as Math.pow(x, y)
:
let x = 5;
let z = Math.pow(x,2); // result is 25
exponentiation assignment
**=
let x = 5;
x **= 2; // result 25
Chrome 52 and Edge 14 was the first browsers to fully support the Exponentiation Operator:
Chrome 52 | Edge 14 | Firefox 52 | Safari 10.1 | Opera 39 |
Jul 2016 | Aug 2016 | Mar 2017 | Mar 2017 | Aug 2016 |
ECMAScript 2016 introduced Array.prototype.includes
to arrays.
This allows us to check if an element is present in an array:
const fruits = ["Banana", "Orange", "Apple", "Mango"];
fruits.includes("Mango"); // is true
All modern browsers support Array.prototype.includes:
Chrome 47 | Edge 14 | Firefox 43 | Safari 9 | Opera 34 |
Dec 2015 | Aug 2016 | Dec 2015 | Oct 2015 | Dec 2015 |