Parameters or Arguments
number The wide variety to use in the calculation. It need to be a fee that is larger than 0
The log() feature returns the natural logarithm of a number.
If the number is 0, the log() feature will return -Infinity.
If the quantity is a terrible value, the log() feature will return NaN.
Math is a placeholder object that contains mathematical features and constants of which log() is one of these functions.
console.log(Math.log(1)); console.log(Math.log(2.5)); console.log(Math.log(0)); console.log(Math.log(-4));
In this example, we have invoked the log() characteristic the use of the Math class.
We have written the output of the log() feature to the net browser console log, for demonstration purposes, to show what the log() feature returns.
The following will be output to the web browser console log:
0 0.9162907318741551 -Infinity NaN
In this example, the first output to the console log back 0 which is the natural logarithm of 1.
The 2d output to the console log lower back 0.9162907318741551 which is the herbal logarithm of 2.5.
The second output to the console log again -Infinity on account that the quantity provided was zero
The 2d output to the console log back NaN since the variety supplied was a bad value.