staticdata.dev
Menu
Datasets About Contact

JavaScript String Methods

A reference of the 37 standard (non-Annex B) JavaScript String methods, covering both String.prototype instance methods and the static methods on String itself (fromCharCode, fromCodePoint, raw). Each record documents the method name, its full call signature with parameter types, the return type, a concise description of its behavior and edge cases, and the ECMAScript edition in which it was standardized — from ES1 foundational methods like indexOf and charAt through ES2024 additions toWellFormed and isWellFormed.

v1.0.0 MIT 37 records Updated 2026-10-05 stable Source:  MDN Web Docs — String, ECMAScript Language Specification

Quick fetch

Stable URL. CORS-enabled. No auth.

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

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

Formats

  • JSON 10.5 KB

    /v1/js-string-methods.json

    Open

    min: 9.2 KB · /v1/js-string-methods.min.json

  • CSV 6.9 KB

    /v1/js-string-methods.csv

    Open
  • TypeScript 10.8 KB

    /v1/js-string-methods.ts

    export const jsStringMethods

    type StringMethod = (typeof jsStringMethods)[number]

    Open

Schema

Each record in the dataset has the following shape.

Schema
Field Type Description Example
name string Method name (no prototype prefix) slice
signature string Full call signature including parameters and optional markers String.prototype.slice(beginIndex, endIndex?)
returns string TypeScript-style return type string
description string Concise description of what the method does and notable edge cases Extracts a section of a string and returns it as a new string.
ecmaVersion string ECMAScript edition that introduced this method (e.g. ES1, ES2015, ES2024) ES2015

Preview

First 10 records.

Data preview
namesignaturereturnsdescriptionecmaVersion
atString.prototype.at(index)string | undefinedReturns the character at the given index, supporting negative indices to count from the end of the string.ES2022
charAtString.prototype.charAt(index)stringReturns a new string consisting of the single UTF-16 code unit at the given index. Returns an empty string if the index is out of range.ES1
charCodeAtString.prototype.charCodeAt(index)numberReturns an integer between 0 and 65535 representing the UTF-16 code unit at the given index. Returns NaN if the index is out of range.ES1
codePointAtString.prototype.codePointAt(pos)number | undefinedReturns a non-negative integer that is the Unicode code point value of the character at the given position. Returns undefined if the position is out of range.ES2015
concatString.prototype.concat(...strings)stringConcatenates the string arguments to the calling string and returns a new string.ES3
endsWithString.prototype.endsWith(searchString, endPosition?)booleanDetermines whether a string ends with the characters of a specified string. Returns true or false.ES2015
fromCharCodeString.fromCharCode(...codes)stringReturns a string created from the specified sequence of UTF-16 code unit values. This is a static method on String, not on String.prototype.ES1
fromCodePointString.fromCodePoint(...codePoints)stringReturns a string created by using the specified sequence of Unicode code points. This is a static method on String, not on String.prototype.ES2015
includesString.prototype.includes(searchString, position?)booleanDetermines whether one string may be found within another string, returning true or false.ES2015
indexOfString.prototype.indexOf(searchValue, fromIndex?)numberReturns the index of the first occurrence of a specified value in a string. Returns -1 if the value is not found.ES1

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

Fetch examples

Drop-in snippets in five languages.

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

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

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

print(jsStringMethods[0])
Go
package main

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

func main() {
	resp, err := http.Get("https://staticdata.dev/v1/js-string-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-string-methods.min.json").call()?.into_string()?;
    let data: Vec<Value> = serde_json::from_str(&body)?;
    println!("{:?}", data.first());
    Ok(())
}

Sources and methodology

This dataset enumerates every standard method defined on String.prototype as well as the three static methods on String itself (fromCharCode, fromCodePoint, and raw), drawing from the MDN Web Docs String reference and the ECMAScript specification maintained by TC39. Methods are sorted alphabetically by name. Each record captures the authoritative call signature using TypeScript-style optional parameter notation (?), the return type expressed in TypeScript notation, a description that covers both typical usage and important edge-case behavior (such as how substring treats negative indices differently from slice), and the ECMAScript edition in which the method was first standardized.

ECMAScript version labels use the modern year-based naming convention where applicable (ES2015 rather than ES6, ES2017 rather than ES8, and so on). Legacy methods that predate the year-based convention are labeled ES1, ES3, or ES5 per the numbered editions. The set is complete as of ES2026 (October 2026); the most recent additions are from ES2024 (isWellFormed and toWellFormed), which address well-formedness of strings containing lone surrogate code units — a correctness concern when passing JavaScript strings to APIs that require valid Unicode sequences such as encodeURIComponent or TextEncoder.

Note that the legacy web-compatibility methods in ECMA-262 Annex B are not included: the trimLeft/trimRight aliases, substr, and the HTML wrapper methods (anchor, big, blink, bold, fixed, fontcolor, fontsize, italics, link, small, strike, sub, sup). They still exist in browsers and Node.js but are discouraged for new code. The dataset reflects the normative set a developer should know and reference, not the exhaustive list of every historically shipped string API.

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-string-methods changelog for this dataset's history.

Related datasets

More Code datasets