/

HTML / CSS / JavaScript Tutorial

JavaScript Operator: exponentiation

[this page | pdf | back links]

In JavaScript, the ** operator is the (binary) arithmetic operator for exponentiation.

 

For example, if x is 8 then y = x ** 5 results in y becoming 32768.

 

Note: older browsers may not recognise this operator or the **= operator, in which case the Math.pow() method would need to be used.

 


NAVIGATION LINKS
Contents | Prev | Next | JavaScript Operators


Desktop view | Switch to Mobile