Math

Math.pow

Returns the base raised to the exponent power

Syntax

JavaScript
Math.pow(base, exponent)

Parameters

ParameterTypeDescription
basenumberThe base number
exponentnumberThe exponent used to raise the base

Return Value

A number representing base to the power of exponent

Examples

Basic Usage
console.log(Math.pow(2, 10)); // 1024
console.log(Math.pow(7, 2)); // 49
Practical Example
// The ** operator is the modern alternative:
console.log(2 ** 10); // 1024
console.log(3 ** 3); // 27
Advanced Usage
console.log(Math.pow(4, 0.5)); // 2 (same as square root)
console.log(Math.pow(8, 1/3)); // 2 (cube root)

Understanding Math.pow

The Math.pow method in JavaScript returns the base raised to the exponent power. It belongs to the Math object and is one of the most widely used methods for working with math values in modern JavaScript and TypeScript applications.

The method signature is Math.pow(base, exponent). It accepts 2 parameters: base, exponent. When called, it returns a number representing base to the power of exponent. Understanding when and how to use pow() helps you write more expressive, readable code.

Common use cases for Math.pow include data transformation, input validation, API response processing, and building reusable utility functions. It works well alongside related methods like math-sqrt, math-cbrt, math-log, enabling you to chain operations together for complex data manipulation pipelines.

Browser support for Math.pow is excellent across all modern browsers including Chrome, Firefox, Safari, and Edge. It is also fully supported in Node.js and Deno. For older environments, transpilation with Babel or a polyfill may be needed.

Browser Compatibility

Supported in all modern browsers (Chrome, Firefox, Safari, Edge) and Node.js. Part of the ECMAScript standard.

Related Methods

More Math Methods

Other methods in the Math object

Related Tools

More Math Methods

Explore JavaScript Methods

Browse our complete reference of 410 JavaScript methods with syntax, examples, and explanations.