Math.LN10

Baseline Widely available

This feature is well established and works across many devices and browser versions. It’s been available across browsers since July 2015.

Thuộc tính dữ liệu tĩnh Math.LN10 biểu thị logarithm tự nhiên của 10, xấp xỉ 2.303.

Try it

function getNatLog10() {
  return Math.LN10;
}

console.log(getNatLog10());
// Expected output: 2.302585092994046

Giá trị

𝙼𝚊𝚝𝚑.𝙻𝙽𝟷𝟶=ln(10)2.303\mathtt{Math.LN10} = \ln(10) \approx 2.303
Property attributes of Math.LN10
Writableno
Enumerableno
Configurableno

Mô tả

LN10 là thuộc tính tĩnh của Math, bạn luôn sử dụng nó dưới dạng Math.LN10, thay vì là thuộc tính của một đối tượng Math bạn tạo ra (Math không phải là constructor).

Ví dụ

Sử dụng Math.LN10

Hàm sau trả về logarithm tự nhiên của 10:

js
function getNatLog10() {
  return Math.LN10;
}

getNatLog10(); // 2.302585092994046

Đặc tả kỹ thuật

Thông số kỹ thuật
ECMAScript® 2027 Language Specification
# sec-math.ln10

Tương thích trình duyệt

Xem thêm