Home>Article>Web Front-end> What does log in javascript mean?
Log in JavaScript means "logarithm" and is a method of the Math object. The syntax is "Math.log(x)"; the log() method can return the natural logarithm of the number "x". If the parameter value is a negative number, the return result is "NaN". If the parameter value is 0, the return result is "-Infinity".
The operating environment of this tutorial: Windows 10 system, JavaScript version 1.8.5, Dell G3 computer.
What is the meaning of log in JavaScript
log in JavaScript means "logarithm", the log() method returns the natural value of a number Logarithm (base E).
The syntax of this method is as follows:
Math.log(x)
If the parameter x is a negative number, NaN will be returned. If parameter x is 0, then -Infinity is returned. The result returned is the natural logarithm of x.
The example is as follows:
123 单击按钮显示不同数值的自然对数。
Output result:
##[Related recommendations:The above is the detailed content of What does log in javascript mean?. For more information, please follow other related articles on the PHP Chinese website!