staticdata.dev
Menu
Datasets About Contact

JavaScript Math Methods

45 entries covering every static method and constant on the JavaScript Math object, from arithmetic helpers like Math.abs() and Math.pow() to trigonometric functions, logarithms, hyperbolic functions, rounding methods, and the eight built-in mathematical constants such as Math.PI and Math.E.

v1.0.0 MIT 45 records Updated 2026-10-05 stable Source:  MDN Web Docs — Math

Quick fetch

Stable URL. CORS-enabled. No auth.

bash
curl https://staticdata.dev/v1/js-math-methods.json

Or use as a typed import: import { jsMathMethods } from "https://staticdata.dev/v1/js-math-methods.ts"

Formats

  • JSON 7.5 KB

    /v1/js-math-methods.json

    Open

    min: 6.4 KB · /v1/js-math-methods.min.json

  • CSV 4.7 KB

    /v1/js-math-methods.csv

    Open
  • TypeScript 7.7 KB

    /v1/js-math-methods.ts

    export const jsMathMethods

    type MathMethod = (typeof jsMathMethods)[number]

    Open

Schema

Each record in the dataset has the following shape.

Schema
Field Type Description Example
name string Full name of the Math property or method Math.abs()
signature string Call signature including parameter names Math.abs(x)
description string Concise description of behavior and return value Returns the absolute value of x.

Preview

First 10 records.

Data preview
namesignaturedescription
Math.EMath.EEuler's number and the base of natural logarithms; approximately 2.718.
Math.LN2Math.LN2Natural logarithm of 2; approximately 0.693.
Math.LN10Math.LN10Natural logarithm of 10; approximately 2.303.
Math.LOG2EMath.LOG2EBase-2 logarithm of E; approximately 1.443.
Math.LOG10EMath.LOG10EBase-10 logarithm of E; approximately 0.434.
Math.PIMath.PIRatio of the circumference of a circle to its diameter; approximately 3.14159.
Math.SQRT1_2Math.SQRT1_2Square root of 1/2 (equivalently, 1 over the square root of 2); approximately 0.707.
Math.SQRT2Math.SQRT2Square root of 2; approximately 1.414.
Math.abs()Math.abs(x)Returns the absolute value of x. Returns NaN if x is NaN; returns 0 for -0.
Math.acos()Math.acos(x)Returns the arccosine (in radians) of x, for x in the range [-1, 1]. Returns NaN if x is outside that range.

Showing 10 of 45. View full data:  JSON · CSV

Fetch examples

Drop-in snippets in five languages.

curl
curl -sSL https://staticdata.dev/v1/js-math-methods.json | jq '.[0]'
JavaScript
import type { MathMethod } from "https://staticdata.dev/v1/js-math-methods.ts";

const res = await fetch("https://staticdata.dev/v1/js-math-methods.min.json");
if (!res.ok) throw new Error(`Fetch failed: ${res.status}`);
const jsMathMethods: MathMethod[] = await res.json();
console.log(jsMathMethods[0]);
Python
import urllib.request, json

with urllib.request.urlopen("https://staticdata.dev/v1/js-math-methods.min.json") as r:
    jsMathMethods = json.load(r)

print(jsMathMethods[0])
Go
package main

import (
	"encoding/json"
	"fmt"
	"net/http"
)

func main() {
	resp, err := http.Get("https://staticdata.dev/v1/js-math-methods.min.json")
	if err != nil { panic(err) }
	defer resp.Body.Close()

	var data []map[string]any
	if err := json.NewDecoder(resp.Body).Decode(&data); err != nil {
		panic(err)
	}
	fmt.Println(data[0])
}
Rust
use serde_json::Value;

fn main() -> Result<(), Box<dyn std::error::Error>> {
    let body = ureq::get("https://staticdata.dev/v1/js-math-methods.min.json").call()?.into_string()?;
    let data: Vec<Value> = serde_json::from_str(&body)?;
    println!("{:?}", data.first());
    Ok(())
}

Sources and methodology

The dataset is curated from the MDN Web Docs Math reference, which documents the built-in Math object available in all JavaScript environments. The Math object is not a constructor; all properties and methods are accessed as static members (e.g., Math.sqrt(4)). The eight mathematical constants (Math.E, Math.LN2, Math.LN10, Math.LOG2E, Math.LOG10E, Math.PI, Math.SQRT1_2, Math.SQRT2) are included alongside all static methods.

Method signatures follow the same convention used by MDN: parameter names reflect intent (x for a single numeric input, y, x for the two-argument atan2, ...values for variadic methods). Descriptions include edge-case behavior (NaN propagation, ±Infinity results, domain restrictions) so consumers can use the data to generate accurate documentation or developer tooling.

The dataset includes two recent additions: Math.f16round() (ES2025), which mirrors Math.fround() but targets 16-bit half-precision floats, and Math.sumPrecise() (ES2026), which sums an iterable as if with exact arithmetic and rounds once. As of October 2026, Math.sumPrecise() is not yet available in every engine (it is missing from Node.js 26.0, for example). Implementations that target older environments should filter these entries by cross-referencing a compatibility table.

Versioning

URLs under /v1/ are stable: field names and types will not change in a way that breaks consumers. Values can be corrected or records added when the upstream source changes; schema-incompatible updates ship under a new version path. See the js-math-methods changelog for this dataset's history.

More Code datasets