JavaScript Math.pow()
Beispiel
let x = Math.pow(4, 3);
Definition und Verwendung
Die Methode Math.pow() gibt den Wert von x hoch y (x y ) zurück.
Mehr Beispiele
let a = Math.pow(0, 1);
let b = Math.pow(1, 1);
let c = Math.pow(1, 10);
let d = Math.pow(3, 3);
let e = Math.pow(-3, 3);
let f = Math.pow(2, 4);
Browser-Unterstützung
Math.pow()
ist eine ECMAScript1 (ES1)-Funktion.
ES1 (JavaScript 1997) wird in allen Browsern vollständig unterstützt:
Chrome | IE | Edge | Firefox | Safari | Opera |
Yes | Yes | Yes | Yes | Yes | Yes |
Syntax
Math.pow(x, y)
Parameter
Parameter | Description |
---|---|
x | Required. The base |
y | Required. The exponent |
Rückgabewert
Eine Zahl, die den Wert von x hoch y darstellt (x y ). |