CodesJava

Easy learning with example program codes

JavaScript math log() method

The JavaScript math log() method is used to get the natural logarithm of a number.
Syntax:

Math.log(n)

Parameters
n: It represents the number whose logarithm have to be get.

Returns
Logarithm of a number

Example

<!DOCTYPE html>
<html>
<body>
<script>  
document.writeln(Math.log(2));  
</script>  
</body>
</html>

Output

0.6931471805599453
Please follow and like us:
error








Copyright © 2019 CodesJava DMCA.com Protection Status