How to raise 10 to a power in JavaScript?

Sometimes, we want to raise 10 to a power in JavaScript.

In this article, we’ll look at how to raise 10 to a power in JavaScript.

How to raise 10 to a power in JavaScript?

To raise 10 to a power in JavaScript, we can use the exponentiation (**) operator.

For instance, we write:

const precision = 5
const result = 10 ** precision;
console.log(result)

to raise 10 the precision power.

Therefore, result is 100000.

Conclusion

To raise 10 to a power in JavaScript, we can use the exponentiation (**) operator.