英[paʊ]

n.Head, ping (onomatopoeia for shooting, explosion, etc.)

javascript pow() method syntax

Function: Returns the value of x raised to the y power.

Syntax: Math.pow(x,y)

Parameters: x Required. base. Must be a number. y is required. Power number. Must be a number.​

Return: x raised to the y power.

Description: If the result is an imaginary or negative number, this method will return NaN. If a floating point overflow occurs due to an exponent that is too large, this method returns Infinity.

javascript pow() method example

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>

<script type="text/javascript">
//把 pow() 运用到不同的数字组合上
    document.write(Math.pow(0,0) + "<br />")
    document.write(Math.pow(0,1) + "<br />")
    document.write(Math.pow(1,1) + "<br />")
    document.write(Math.pow(1,10) + "<br />")
    document.write(Math.pow(2,3) + "<br />")
    document.write(Math.pow(-2,3) + "<br />")
    document.write(Math.pow(2,4) + "<br />")
    document.write(Math.pow(-2,4) + "<br />")

</script>

</body>
</html>

Run instance »

Click the "Run instance" button to view the online instance