X
HOME HTML CSS JAVASCRIPT SQL PHP JQUERY XML ASP.NET MORE...
REFERENCES | EXAMPLES | FORUM | ABOUT

JavaScript pow() Method

Math Object Reference JavaScript Math Object

Example

Return the value of the number 4 to be the power of 3 (4*4*4):

Math.pow(4, 3);

The result will be:

64

Try it yourself »


Definition and Usage

The pow() method returns the value of x to the power of y (xy).


Browser Support

Internet Explorer Firefox Opera Google Chrome Safari

The pow() method is supported in all major browsers.


Syntax

Math.pow(x,y)

Parameter Values

Parameter Description
x Required. The base
y Required. The exponent

Return Value

Type Description
Number The value of x to the power of y (xy).

Technical Details

JavaScript Version: 1.0


More Examples

Example

Use the pow() method on different numbers:

var a = Math.pow(0, 1);
var b = Math.pow(1, 1);
var c = Math.pow(1, 10);
var d = Math.pow(3, 3);
var e = Math.pow(-3, 3);
var f = Math.pow(2, 4);

The result of a,b,c,d,e, and f will be:

0
1
1
27
-27
16

Try it yourself »


Math Object Reference JavaScript Math Object

Your suggestion:

Close [X]

Thank You For Helping Us!

Your message has been sent to W3Schools.

Close [X]
Search w3schools.com:

WEB BUILDING

Download XML Editor FREE Website BUILDER Free HTML5 Templates FREE Website Templates Free HTML Templates

SHARE THIS PAGE

facebook