ฟังก์ชัน pow() ของอ็อบเจกต์ Math ยอมรับตัวเลขสองตัวและส่งกลับค่าของอาร์กิวเมนต์แรกที่ยกกำลังของอาร์กิวเมนต์ที่สอง
ไวยากรณ์
ไวยากรณ์ของมันคือดังต่อไปนี้
Math.pow(48, 2);
ตัวอย่าง
<html>
<head>
<title>JavaScript Example</title>
</head>
<body>
<script type="text/javascript">
var result = Math.pow(48, 2);
document.write("Result "+result);
</script>
</body>
</html> ผลลัพธ์
Result 2304