Languages
[Edit]
EN

JavaScript - Math.log10() method example

9 points
Created by:
Aaron1
568

The Math.log10() method returns the logarithm with base 10 of a number. 

The Math.log10() method is presented on the following chart:

Math.log10(x) function visualization - JavaScript Math Object.
Math.log10(x) function visualization - JavaScript Math Object.

1. Documentation

Edit
SyntaxMath.log10(x)
Parametersx - integer or float number value in the range 0 to +Infinity (primitive value).
Result

number value calculated as log_10(x) mathematical function (primitive value).

If x is negative it returns NaN.

If x is equal to 0 it returns -Infinity.

If x is equal to +Infinity it returns -Infinity.

Description

log10 is a static method that takes one parameter and returns an approximation of the log_10(x) mathematical function (logarithm with base 10). log10 is called a common logarithm.

Note: this method has been introduced in ES 2015.


2. Custom method implementation example

Edit

3. Canvas plot example

Edit

References

Edit
  1. Logarithm - Wikipedia

Alternative titles

  1. JavaScript - Math.log10() documentation with examples
  2. js - Math.log10() method documentation with examples
1
Donate to Dirask
Our content is created by volunteers - like Wikipedia. If you think, the things we do are good, donate us. Thanks!
Join to our subscribers to be up to date with content, news and offers.

JavaScript - Math documentation (EN)

Native Advertising
🚀
Get your tech brand or product in front of software developers.
For more information Contact us
Dirask - we help you to
solve coding problems.
Ask question.

❤️💻 🙂

Join