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