Languages
[Edit]
EN

ES7 / ES2016 / ECMAScript 2016 - Exponentiation operator (**) example

3 points
Created by:
Root-ssh
178170

In this article, we would like to show you how to use Exponentiation Operator (**) that has been introduced in ECMAScript 2016.

1. Exponentiation Operator example

Edit

Note:

For negative literal base values we need to use brackets becase of the syntax error, e.g.

  • (-2.0) ** 0.5 - correct syntax
  • -2.0 ** 0.5 - incorrect syntax

See also

Edit
  1. JavaScript - Math.pow() method example
1
Donate to Dirask
Our content is created by volunteers - like Wikipedia. If you think, the things we do are good, donate us. Thanks!
Join to our subscribers to be up to date with content, news and offers.
Native Advertising
🚀
Get your tech brand or product in front of software developers.
For more information Contact us
Dirask - we help you to
solve coding problems.
Ask question.

❤️💻 🙂

Join