จาวาสคริปต์ Math.pow()
ตัวอย่าง
let x = Math.pow(4, 3);
ความหมายและการใช้งาน
Math.pow() วิธีการคืนค่า x ยกกำลัง y (x y )
ตัวอย่างเพิ่มเติม
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);
รองรับเบราว์เซอร์
Math.pow()
เป็นคุณลักษณะ ECMAScript1 (ES1)
ES1 (JavaScript 1997) ได้รับการสนับสนุนอย่างสมบูรณ์ในเบราว์เซอร์ทั้งหมด:
Chrome | IE | Edge | Firefox | Safari | Opera |
Yes | Yes | Yes | Yes | Yes | Yes |
ไวยากรณ์
Math.pow(x, y)
พารามิเตอร์
Parameter | Description |
---|---|
x | Required. The base |
y | Required. The exponent |
คืนมูลค่า
ตัวเลขที่แสดงค่าของ x ยกกำลัง y (x y ) |