February 2018
Intermediate to advanced
298 pages
8h 22m
English
ES7 introduced a new way to perform an exponential calculation with JavaScript, that is, with a new ** operator. If you're coming from a Python background, you should immediately be able to relate to this. A single asterisk denotes multiplication; however, two together denote an exponential. a**b means a raised to the power b. Take a look at the following example:
const a = 5**5;const b = Math.pow(5, 5);console.log(a);console.log(a == b);
The output is as follows:
3125true
Math.pow was earlier used to perform an exponential calculation. Now, a**b means multiply a b times with itself.
Read now
Unlock full access