JavaScript Math LOG10E
Syntax & Examples
Math.LOG10E static-property
The Math.LOG10E property represents the base-10 logarithm of Euler's number (E), which is approximately equal to 0.434.
Syntax of Math.LOG10E
The syntax of Math.LOG10E static-property is:
Math.LOG10EThis LOG10E static-property of Math base-10 logarithm of E; approximately 0.434.
✐ Examples
1 Using Math.LOG10E to calculate logarithmic values
In JavaScript, we can use the Math.LOG10E property to assist in base-10 logarithm calculations.
For example,
- We create a variable
logValueand set it toMath.LOG10E. - We log
logValueto the console using theconsole.log()method.
JavaScript Program
const logValue = Math.LOG10E;
console.log(logValue);Output
0.4342944819032518
2 Using Math.LOG10E in a logarithmic expression
In JavaScript, we can use the Math.LOG10E property in logarithmic expressions.
For example,
- We create a variable
xand set it toMath.E. - We calculate the base-10 logarithm of
xusingMath.LOG10E. - The result is stored in the variable
logResult. - We log
logResultto the console using theconsole.log()method.
JavaScript Program
const x = Math.E;
const logResult = Math.LOG10E;
console.log(logResult);Output
0.4342944819032518
3 Using Math.LOG10E in a mathematical formula
In JavaScript, we can use the Math.LOG10E property in various mathematical formulas involving logarithms.
For example,
- We create variables
aandbrepresenting two numbers. - We calculate the base-10 logarithm of the quotient of
aandbusingMath.LOG10E. - The result is stored in the variable
logQuotient. - We log
logQuotientto the console using theconsole.log()method.
JavaScript Program
const a = 10;
const b = 5;
const logQuotient = Math.log10(a / b);
console.log(logQuotient);Output
0.3010299956639812
Summary
In this JavaScript tutorial, we learned about LOG10E static-property of Math: the syntax and few working examples with output and detailed explanation for each example.