Open links in new tab
    • Work Report
    • Email
    • Rewrite
    • Speech
    • Title Generator
    • Smart Reply
    • Poem
    • Essay
    • Joke
    • Instagram Post
    • X Post
    • Facebook Post
    • Story
    • Cover Letter
    • Resume
    • Job Description
    • Recommendation Letter
    • Resignation Letter
    • Invitation Letter
    • Greeting Message
    • Try more templates
  1. The Math object in JavaScript provides a variety of methods to perform mathematical tasks on numbers. It includes methods for rounding, trigonometry, logarithms, and more.

    Example: Rounding Methods

    console.log(Math.round(4.6)); // 5
    console.log(Math.ceil(4.2)); // 5
    console.log(Math.floor(4.9)); // 4
    console.log(Math.trunc(4.9)); // 4
    Copied!

    Common Math Methods

    1. Math.abs(x)

    Returns the absolute value of x.

    console.log(Math.abs(-4.7)); // 4.7
    Copied!

    2. Math.pow(x, y)

    Returns the value of x to the power of y.

    console.log(Math.pow(8, 2)); // 64
    Copied!

    3. Math.sqrt(x)

    Returns the square root of x.

    console.log(Math.sqrt(64)); // 8
    Copied!

    4. Math.random()

    Returns a random number between 0 (inclusive) and 1 (exclusive).

    console.log(Math.random()); // e.g., 0.123456789
    Copied!

    5. Math.min() and Math.max()

    Returns the lowest or highest value in a list of arguments.

    console.log(Math.min(0, 150, 30, 20, -8, -200)); // -200
    console.log(Math.max(0, 150, 30, 20, -8, -200)); // 150
    Copied!

    Important Considerations

    Feedback
  2. Math - JavaScript | MDN - MDN Web Docs

    Unlike most global objects, Math is not a constructor. You cannot use it with the new operator or invoke the Math object as a function. All properties and methods of Math a…
    Overview

    The Math namespace object contains static properties and methods for mathematical constants and functions.
    Math works with the Number type. It doesn't work with BigInt.

    Static properties

    Math.E
    Euler's number and the base of natural logarithms; approximately 2.718.
    Math.LN10
    Natural logarithm of 10; approximately 2.303.

    Static methods

    Math.abs()
    Returns the absolute value of x.
    Math.acos()
    Returns the arccosine of x.
    Math.acosh()
    Returns the hyperbolic arccosine of x.

    Examples

    Converting between degrees and radians
    The trigonometric functions sin(), cos(), tan(), asin(), acos(), atan(), and atan2() expect (and return) angles in radians. Since humans tend to think in degrees, and some functions (such as CSS transforms) can a…

  3. JavaScript Math Object - W3Schools

    The Math Object The JavaScript Math object allows you to perform mathematical tasks. The Math object is static. All methods and properties can be used without creating a Math object first.

  4. JavaScript Math Object - GeeksforGeeks

    Jul 11, 2025 · JavaScript Math object is used to perform mathematical operations on numbers. All the properties of Math are static and unlike other objects, it does not have a constructor.

  5. JavaScript - Math - Online Tutorials Library

    The JavaScript math object provides properties and methods for mathematical constants and functions. Unlike other global objects, Math is not a constructor. …

  6. Math - The complete JavaScript Tutorial

    For a full list of the methods found on the Math object, please see this reference. With that in mind, here's a list of the most relevant and interesting methods found on the Math object.

  7. Math - JavaScript | MDN

    Jun 27, 2017 · All properties and methods of Math are static. You refer to the constant pi as Math.PI and you call the sine function as Math.sin(x), where x is the method's argument. Constants are defined …

  8. JavaScript Math Object - Programiz

    Math is not a constructor function. It's a property of the implicit global object. In this reference page, you will find all methods of Math object. You can access methods and constants of the Math object …

  9. JavaScript Math Object: A Comprehensive Guide - tutorialpedia.org

    In this blog post, we will explore the Math object in detail, covering its fundamental concepts, usage methods, common practices, and best practices. The Math object in JavaScript is a static object, …

  10. JavaScript Math Operations: Useful Methods and Examples

    Understanding the Math object’s methods can significantly enhance your ability to write efficient and accurate JavaScript code. In this blog post, we will explore some of the most useful methods of the …

  11. Basic math in JavaScript — numbers and operators - MDN Web Docs

    Aug 18, 2025 · At this point in the course, we discuss math in JavaScript — how we can use operators and other features to successfully manipulate numbers to do our bidding.