let x = Math.log(2);
Try it Yourself »
let a = Math.log(2.7183);
let b = Math.log(2);
let c = Math.log(1);
let d = Math.log(0);
let e = Math.log(-1);
Try it Yourself »
The Math.log()
method returns the natural logarithm (base E) of a number.
Math.log(
x)
Parameter | Description |
x | Required. A number. |
Type | Description |
Number | The natural logarithm of the number.NaN if the number is negative.-Infinity if the number is 0. |
Math.log()
is an ECMAScript1 (ES1) feature.
ES1 (JavaScript 1997) is fully supported in all browsers:
Chrome | Edge | Firefox | Safari | Opera | IE |
Yes | Yes | Yes | Yes | Yes | Yes |
截取页面反馈部分,让我们更快修复内容!也可以直接跳过填写反馈内容!