ES6 - Math.log(x) Function


Advertisements


Returns the natural logarithm of X.

Syntax

Math.log(x)    

Parameter

  • X − represents a number

Example

console.log("---Math.log()---") 
console.log("Math.log(Math.E): "+Math.log(Math.E)) 
console.log("Math.log(17.5): "+Math.log(17.5))         

Output

---Math.log()--- 
Math.log(Math.E): 1 
Math.log(17.5): 2.8622008809294686           

es6_math.htm

Advertisements