JavaScript Math Object : pow(x, y)

The pow() method returns the value of x to the power of y. Syntax :
  Math.pow(num1, num2);
Where num1 represents the base number and num2 represents the exponents. (baseexponent).

Example :
 <script>
  var x = Math.pow(10, 2);
  document.write("pow(10, 2) : " + x + "<br/>");
  var x = Math.pow(2, 10);
  document.write("pow(2, 10) : " + x + "<br/>");
  var x = Math.pow(5, 3);
  document.write("pow(5, 3) : " + x + "<br/>");
</script>
Output :


Next Topic :