ES6 - Math Pow() Function



This method returns the base to the exponent power, that is, base to the power exponent.

Syntax

Math.pow(x, y) 

Parameter

  • x − represents base
  • y − represents the exponent

Return Value

Returns the base to the exponent power.

Example

console.log("---Math.pow()---") 
console.log("math.pow(2,3) : "+Math.pow(2, 3)) 
console.log("Math.pow(1.7, 2.3) : "+Math.pow(1.7, 2.3))            

Output

---Math.pow()--- 
math.pow(2,3) : 8 
Math.pow(1.7, 2.3) : 3.388695291147646             
Advertisements