JavaScript Math.pow()
Contoh
let x = Math.pow(4, 3);
Definisi dan Penggunaan
Metode Math.pow() mengembalikan nilai x ke pangkat y (x y ).
Lebih Banyak Contoh
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);
Dukungan Peramban
Math.pow()
adalah fitur ECMAScript1 (ES1).
ES1 (JavaScript 1997) didukung penuh di semua browser:
Chrome | IE | Edge | Firefox | Safari | Opera |
Yes | Yes | Yes | Yes | Yes | Yes |
Sintaksis
Math.pow(x, y)
Parameter
Parameter | Description |
---|---|
x | Required. The base |
y | Required. The exponent |
Nilai Kembali
Angka yang mewakili nilai x pangkat y (x y ). |