JavaScript log10() method
- Previous Page log()
- Next Page log1p()
- Go to the Previous Level JavaScript Math Reference Manual
Definition and usage
log10()
The method returns the logarithm base 10 of the number.
Instance
Example 1
Return the logarithm base 10 of the number "2":
Math.log10(2);
Example 2
Use the log10() method for different numbers:
var a = Math.log10(2.7183); var b = Math.log10(2); var c = Math.log10(1); var d = Math.log10(0); var e = Math.log10(-1);
Syntax
Math.log10(x)
Parameter value
Parameter | Description |
---|---|
x | Required. Number. |
Technical details
Return value: |
A number, representing the logarithm of the number with base 10
|
---|---|
JavaScript Version: | ECMAScript 2015 |
Browser Support
Method | Chrome | Edge | Firefox | Safari | Opera |
---|---|---|---|---|---|
log10() | 38.0 | 12.0 | 25.0 | 8.0 | 25.0 |
Related Pages
Tutorial:JavaScript Math
- Previous Page log()
- Next Page log1p()
- Go to the Previous Level JavaScript Math Reference Manual