Javascript Math pow()

Introduction

The Math.pow() function returns the base to the exponent power, baseexponent.
Math.pow(base, exponent)
//base - The base number.
//exponent - The exponent used to raise the base.
let a = Math.pow(7, 2);    
console.log(a);/* w  w  w. ja  v a 2s  .com*/
a = Math.pow(2, 10);   
console.log(a);
a = Math.pow(4, 0.5);  
console.log(a);
a = Math.pow(8, 1/3);  
console.log(a);
a = Math.pow(7, -2);   
console.log(a);
a = Math.pow(8, -1/3); 
console.log(a);
a = Math.pow(-7, 2);   
console.log(a);
a = Math.pow(-7, 1/3); 
console.log(a);



PreviousNext

Related