Math.log()

ES1+

Returns the natural logarithm (base e) of a number.

Syntax

Math.log(x)

Parameters

x number

A number

Return Value

number

The natural logarithm of the given number

Examples

JavaScript
console.log(Math.log(1));
console.log(Math.log(Math.E));
console.log(Math.log(10));
Output:
// 0 1 2.302585092994046