What are ES2016 - ES7 features?
1. Array.prototype.includes
The Array.prototype.includes()
method checks if a given element is present in an array (as an better way compare to indexOf)
2. Exponentiation Operator (**
)
The exponentiation operator (**
) allows you to raise a number to the power of another number.
This operator is equivalent to calling Math.pow(base, exponent)
but is much more concise.
console.log(2 ** 3); // 8 (2 raised to the power of 3)
console.log(5 ** 2); // 25 (5 squared)
console.log(9 ** 0.5); // 3 (square root of 9)