Math.LN2 Property with Example in JavaScript

JavaScript | Math.LN2 Property: Here, we are going to learn about the LN10 property of Math class in JavaScript with Examples.
Submitted by Shivang Yadav, on February 16, 2020

JavaScript | Math.LN2 Property

Math.LN2 is a property in math library of JavaScript that is used to find the value of natural log 2. The value of ln2 = 0.693.

Syntax:

    Math.LN2

Parameter(s):

  • Math.LN2 is a property which does not accept any parameter.

Return value:

The return type of this method is number, it returns a number (float value), value of natural log of 2.

Browser support: Chrome, Internet explorer, Mozilla, Safari, Opera mini.

Example 1:

console.log(Math.LN2);

Output

0.6931471805599453

Example 2: Invalid values

console.log(Math.LN2("JavaScript"));

Output

Uncaught TypeError: Math.LN2 is not a function
    at <anonymous>:1:18

JavaScript Math Object Methods »





Comments and Discussions!

Load comments ↻






Copyright © 2024 www.includehelp.com. All rights reserved.