JavaScript
MaDrs

The definitive JavaScript quick-reference for beginners and experts alike.

Interactive Playground
/
Type
Category
🏗️

Constructor

Methods
20

Array()

Array
constructor

Makes a new empty array.

Array(elements)

Array
constructor

Makes a new array filled with the elements you pass in.

Array(length)

Array
constructor

Makes a sparse array with empty slots.

String()

String
constructor

Converts any value to a string. Works with numbers, booleans, objects, null, undefined, and more.

Number()

Number
constructor

Creates the number 0. Called without arguments, always returns zero. Rarely used since you can...

Number(value)

Number
constructor

Converts any value to a number. Returns NaN for values that cannot be converted. More strict...

Boolean()

Boolean
constructor

Creates a boolean with the value false. Called without arguments, it always returns false.

Boolean(value)

Boolean
constructor

Converts any value to true or false based on its "truthiness". There are exactly 8 falsy values...

Object()

Object
constructor

Creates an empty object. Equivalent to using object literal syntax {}. Rarely used since {} is...

Object(value)

Object
constructor

Wraps a primitive value in an object wrapper, or returns the object unchanged if already an...

Date()

Date
constructor

Creates a Date object for the current local date and time. In practice, use `new Date()` to...

Date(value)

Date
constructor

Creates a Date object from one value: a date string, a timestamp in milliseconds, or another...

Date(year, month, ...)

Date
constructor

Creates a Date object from numeric date/time components in local time (month is 0-based).

RegExp()

RegExp
constructor

Makes a RegExp object that matches an empty string (equivalent to `/(?:)/`).

RegExp(pattern, flags)

RegExp
constructor

Makes a RegExp object using the given pattern (as a string or another RegExp) and optional flags...

Map()

Map
constructor

Creates an empty Map. Use `new Map()` when constructing it.

Map(iterable)

Map
constructor

Creates a Map populated with key-value pairs from an iterable (for example, an array of `[key,...

Set()

Set
constructor

Creates an empty Set. Use `new Set()` when constructing it.

Set(iterable)

Set
constructor

Creates a Set populated with unique values from an iterable (for example, an array, string, or...

Promise()

Promise
constructor

Creates a Promise that represents an async operation. You must call this with `new`. The...

Static

Methods
97

Array.isArray()

Array
static

Checks if a value is an array. Returns true for arrays, false for everything else (objects,...

Array.from()

Array
static

Converts things like strings or array-like objects into real arrays. You can also transform each...

Array.of()

Array
static

Makes an array with whatever elements you pass in, no matter how many or what type. Unlike...

String.fromCharCode()

String
static

Creates a string from UTF-16 code units. Each number becomes one character. Common codes: 65-90...

String.fromCodePoint()

String
static

Creates a string from Unicode code points. Similar to fromCharCode but supports emojis and...

String.raw()

String
static

Returns a string where backslashes are not treated as escape characters. Useful for regex...

Number.EPSILON

Number
static

The smallest number greater than 1 that can be represented as an IEEE 754 double precision...

Number.MAX_SAFE_INTEGER

Number
static

The largest integer that can be safely represented without losing precision (2^53 - 1, or...

Number.MAX_VALUE

Number
static

The largest positive representable number (approximately 1.7976931348623157e+308).

Number.MIN_SAFE_INTEGER

Number
static

The smallest integer that can be safely represented without losing precision (-(2^53 - 1), or...

Number.MIN_VALUE

Number
static

The smallest positive representable number (approximately 5e-324).

Number.NaN

Number
static

The special "Not a Number" value.

Number.NEGATIVE_INFINITY

Number
static

The special negative infinite value (-∞).

Number.POSITIVE_INFINITY

Number
static

The special positive infinite value (+∞).

Number.prototype

Number
static

Provides the Number prototype from which all Numbers inherit.

Number.isFinite()

Number
static

Checks if a value is a finite number. Returns false for Infinity, -Infinity, NaN, and...

Number.isInteger()

Number
static

Checks if a value is a whole number (no decimal part). Does not coerce - strings and other types...

Number.isNaN()

Number
static

Checks if a value is exactly NaN. Only returns true for the NaN value itself. Much better than...

Number.isSafeInteger()

Number
static

Returns `true` if the given value is an integer safe for arithmetic operations (within...

Number.parseFloat()

Number
static

Parses a string and returns a decimal number. Stops at the first non-numeric character. More...

Number.parseInt()

Number
static

Parses a string and returns an integer. Always specify the radix (base) to avoid surprises....

Object.assign()

Object
static

Copies properties from source objects into the target object. Later sources overwrite earlier...

Object.create()

Object
static

Creates a new object with the specified prototype. Use null for an object with no prototype (no...

Object.defineProperty()

Object
static

Defines a new or modifies an existing property on the object with the given descriptor.

Object.defineProperties()

Object
static

Defines or modifies multiple properties on the object using an object of property descriptors.

Object.entries()

Object
static

Returns an array of [key, value] pairs for an object. Perfect for iterating over objects with...

Object.freeze()

Object
static

Makes an object completely immutable. Cannot add, remove, or modify properties. Only freezes the...

Object.fromEntries()

Object
static

Makes an object from an iterable of key-value pairs (e.g., from Array.entries() or Map.entries()).

Object.getOwnPropertyDescriptor()

Object
static

Returns the property descriptor for the given own property of the object (or undefined if not...

Object.getOwnPropertyDescriptors()

Object
static

Returns an object containing all own property descriptors of the object.

Object.getOwnPropertyNames()

Object
static

Returns an array of all own string property names (including non-enumerable ones) of the object....

Object.getOwnPropertySymbols()

Object
static

Returns an array of all own symbol properties of the object.

Object.getPrototypeOf()

Object
static

Returns the prototype of the given object.

Object.hasOwn()

Object
static

Returns `true` if the object has the given property as its own (not inherited), otherwise `false`.

Object.is()

Object
static

Compares two values for exact equality, handling special cases like NaN (unlike strict equality...

Object.isExtensible()

Object
static

Returns `true` if the object is extensible (can have new properties added), otherwise `false`.

Object.isFrozen()

Object
static

Returns `true` if the object is frozen, otherwise `false`.

Object.isSealed()

Object
static

Returns `true` if the object is sealed, otherwise `false`.

Object.keys()

Object
static

Returns an array of an object's own property names (keys). Does not include inherited properties...

Object.preventExtensions()

Object
static

Prevents new properties from being added to the object (makes it non-extensible).

Object.seal()

Object
static

Seals the object, preventing new properties from being added and making existing properties...

Object.setPrototypeOf()

Object
static

Sets the prototype of the object to the given prototype object.

Object.values()

Object
static

Returns an array of an object's own property values. Does not include inherited properties or...

Date.now()

Date
static

Returns the current timestamp as the number of milliseconds since the Unix epoch (January 1,...

Date.parse()

Date
static

Parses a string representation of a date and returns the number of milliseconds since the Unix...

Date.UTC()

Date
static

Returns the number of milliseconds since the Unix epoch for the given UTC date components (month...

Math.E

Math
static

The base of the natural logarithm (Euler's constant, approximately 2.718281828459045).

Math.LN10

Math
static

The natural logarithm of 10 (approximately 2.302585092994046).

Math.LN2

Math
static

The natural logarithm of 2 (approximately 0.6931471805599453).

Math.LOG10E

Math
static

The base-10 logarithm of E (approximately 0.4342944819032518).

Math.LOG2E

Math
static

The base-2 logarithm of E (approximately 1.4426950408889634).

Math.PI

Math
static

The ratio of a circle's circumference to its diameter (approximately 3.141592653589793).

Math.SQRT1_2

Math
static

The square root of 1/2 (approximately 0.7071067811865476).

Math.SQRT2

Math
static

The square root of 2 (approximately 1.4142135623730951).

Math.abs()

Math
static

Returns the absolute value of the given number (removes the sign).

Math.acos()

Math
static

Returns the arccosine (inverse cosine) of the given number (in radians, 0 to π).

Math.acosh()

Math
static

Returns the hyperbolic arccosine (inverse hyperbolic cosine) of the given number (in radians;...

Math.asin()

Math
static

Returns the arcsine (inverse sine) of the given number (in radians, -π/2 to π/2).

Math.asinh()

Math
static

Returns the hyperbolic arcsine (inverse hyperbolic sine) of the given number (in radians).

Math.atan()

Math
static

Returns the arctangent (inverse tangent) of the given number (in radians, -π/2 to π/2).

Math.atan2()

Math
static

Returns the arctangent of the quotient y/x (in radians, -π to π), accounting for the correct...

Math.cbrt()

Math
static

Returns the cube root of the given number.

Math.ceil()

Math
static

Returns the smallest integer greater than or equal to the given number (rounds up).

Math.clz32()

Math
static

Returns the number of leading zero bits in the 32-bit integer representation of the given number.

Math.cos()

Math
static

Returns the cosine of the given number (in radians).

Math.cosh()

Math
static

Returns the hyperbolic cosine of the given number.

Math.exp()

Math
static

Returns e^x, where x is the given number (Euler's number raised to the power).

Math.expm1()

Math
static

Returns the result of subtracting 1 from e^x (more precise for small x than `exp(x) - 1`).

Math.floor()

Math
static

Returns the largest integer less than or equal to the given number (rounds down).

Math.fround()

Math
static

Returns the nearest single-precision (32-bit) float representation of the given number.

Math.hypot()

Math
static

Returns the square root of the sum of squares of the given numbers (Euclidean distance; avoids...

Math.imul()

Math
static

Returns the 32-bit integer result of multiplying two numbers (as if both were 32-bit signed...

Math.log()

Math
static

Returns the natural logarithm (base e) of the given number (value > 0).

Math.log10()

Math
static

Returns the base-10 logarithm of the given number (value > 0).

Math.log1p()

Math
static

Returns the natural logarithm of 1 + x (more precise for small x than `log(1 + x)`).

Math.log2()

Math
static

Returns the base-2 logarithm of the given number (value > 0).

Math.max()

Math
static

Returns the largest of the given numbers (returns `NaN` if any argument is `NaN`).

Math.min()

Math
static

Returns the smallest of the given numbers (returns `NaN` if any argument is `NaN`).

Math.pow()

Math
static

Returns the result of raising the base to the exponent power.

Math.random()

Math
static

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

Math.round()

Math
static

Returns the value rounded to the nearest integer. If the fractional part is exactly 0.5, it...

Math.sign()

Math
static

Returns the sign of the given number: -1 for negative, 0 for zero, 1 for positive, or -0 for...

Math.sin()

Math
static

Returns the sine of the given number (in radians).

Math.sinh()

Math
static

Returns the hyperbolic sine of the given number.

Math.sqrt()

Math
static

Returns the positive square root of the given number (value ≥ 0).

Math.tan()

Math
static

Returns the tangent of the given number (in radians).

Math.tanh()

Math
static

Returns the hyperbolic tangent of the given number.

Math.trunc()

Math
static

Returns the integer part of the given number (truncates the decimal portion without rounding).

RegExp.prototype

RegExp
static

Provides the RegExp prototype from which all RegExps inherit.

JSON.parse()

JSON
static

Converts a JSON string into a JavaScript value (object, array, string, number, boolean, or...

JSON.stringify()

JSON
static

Converts a JavaScript value to a JSON string. Functions, undefined, and Symbols are omitted (or...

Promise.all()

Promise
static

Waits for all promises to complete. If all succeed, resolves with an array of all results (in...

Promise.allSettled()

Promise
static

Waits for all promises to complete (success or failure). Never rejects - always returns a result...

Promise.any()

Promise
static

Resolves as soon as any promise succeeds (first one wins). Only rejects if all promises fail,...

Promise.race()

Promise
static

The first promise to settle (success or failure) wins. Unlike any(), a rejection can win. Useful...

Promise.reject()

Promise
static

Creates a Promise that immediately rejects with the given reason. Useful for returning early...

Promise.resolve()

Promise
static

Creates a Promise that immediately resolves with the given value. Useful for wrapping...

📦

Instance

Methods
183

Most commonly used methods for working with JavaScript data

at()

Array
instance

Returns the element at the index. Supports negative indices to count from the end (-1 is the...

concat()

Array
instance

Combines the array with one or more other arrays or values, returns a new array without...

copyWithin()

Array
instance

Copies a portion of the array to another location within the same array, overwriting existing...

entries()

Array
instance

Returns an iterator that yields [index, value] pairs. Useful when you need both the index and...

every()

Array
instance

Checks whether every element passes a test. Returns `true` only if all elements pass, and...

fill()

Array
instance

Fills all or part of the array with a value. Start and end indices are optional.

filter()

Array
instance

Makes an array with elements that pass the given filtering function (optionally with a `this`...

find()

Array
instance

Returns the first element that passes the test function. Returns undefined if no element passes.

findIndex()

Array
instance

Returns the index of the first element that passes the test function. Returns -1 if no element...

findLast()

Array
instance

Returns the last element that passes the test function (searches from end to start). Returns...

findLastIndex()

Array
instance

Returns the index of the last element that passes the test function (searches from end to...

flat()

Array
instance

Creates a new array with all sub-arrays "flattened" into it. Depth controls how many levels deep...

flatMap()

Array
instance

Maps each element using a function, then flattens the result by one level. Same as calling map()...

forEach()

Array
instance

Runs a function once for each element. Does not return anything (undefined). Use for side...

includes()

Array
instance

Checks if the array contains a specific value. Uses strict equality (===), so objects must be...

indexOf()

Array
instance

Returns the first index where the value is found, or -1 if not found. Uses strict equality (===).

join()

Array
instance

Combines all elements into a single string, with an optional separator between them. Default...

keys()

Array
instance

Returns an iterator that yields the index (0, 1, 2, ...) for each element in the array.

lastIndexOf()

Array
instance

Returns the last index where the value is found, searching backwards. Returns -1 if not found.

map()

Array
instance

Creates a new array by calling a function on every element. The new array has the same length,...

pop()

Array
instance

Removes and returns the last element from the array. Changes the original array. Returns...

push()

Array
instance

Adds one or more elements to the end of the array. Returns the new length. Changes the original...

reduce()

Array
instance

Reduces the array to a single value by calling a function on each element, passing the result to...

reduceRight()

Array
instance

Same as reduce(), but processes elements from right to left instead of left to right.

reverse()

Array
instance

Reverses the array in place and returns it. The first element becomes last, the last becomes first.

shift()

Array
instance

Removes and returns the first element from the array. Changes the original array. All other...

slice()

Array
instance

Returns a shallow copy of a portion of the array. Does not modify the original. Supports...

some()

Array
instance

Checks whether at least one element passes a test. Returns true as soon as one passes, and false...

sort()

Array
instance

Sorts the array in place. Without a compare function, elements are converted to strings and...

splice()

Array
instance

The Swiss Army knife of array modification. Can remove elements, add elements, or both at any...

toReversed()

Array
instance

Returns a new array with elements in reversed order. Does not modify the original (unlike...

toSorted()

Array
instance

Returns a new sorted array. Does not modify the original (unlike sort()). The same compare...

toSpliced()

Array
instance

Returns a new array with elements removed or added. Does not modify the original (unlike splice()).

unshift()

Array
instance

Adds one or more elements to the beginning of the array. Returns the new length. All existing...

values()

Array
instance

Returns an iterator that yields each value in the array. This is the default iterator used by...

with()

Array
instance

Returns a new array with the element at the given index replaced. Does not modify the original....

at()

String
instance

Returns the character at the given index. Supports negative indices to count from the end (-1 is...

charAt()

String
instance

Returns the character at the given index. Similar to at() but returns empty string instead of...

charCodeAt()

String
instance

Returns the UTF-16 code unit (0-65535) at the given index. Use with String.fromCharCode() to...

codePointAt()

String
instance

Returns the Unicode code point at the given index. Unlike charCodeAt, works with emojis and...

concat()

String
instance

Joins two or more strings together and returns a new string. The + operator or template literals...

endsWith()

String
instance

Checks if the string ends with the given characters. The optional length parameter lets you...

includes()

String
instance

Checks if the string contains the given substring anywhere. Case-sensitive.

indexOf()

String
instance

Returns the index of the first occurrence of a substring. Returns -1 if not found. Case-sensitive.

isWellFormed()

String
instance

Returns `true` if this string does not contain lone surrogates, otherwise `false`.

lastIndexOf()

String
instance

Returns the index of the last occurrence of the given value in the string.

localeCompare()

String
instance

Compares two strings using locale-aware sort rules and returns whether the reference string...

match()

String
instance

Retrieves the result of matching a string against a regular expression.

matchAll()

String
instance

Returns an iterator of all results matching a string against a regular expression, including...

normalize()

String
instance

Returns the Unicode Normalization Form of the string.

padEnd()

String
instance

Pads the end of the string with another string until it reaches the target length. If already at...

padStart()

String
instance

Pads the beginning of the string with another string until it reaches the target length. If...

repeat()

String
instance

Returns a new string with the original string repeated the specified number of times.

replace()

String
instance

Replaces the first occurrence of a pattern with a replacement. Use replaceAll() or regex with /g...

replaceAll()

String
instance

Replaces all occurrences of a pattern with a replacement. Simpler than `replace()` with a global...

search()

String
instance

Searches for a match between a regular expression and the string.

slice()

String
instance

Extracts a section of the string and returns it as a new string. Supports negative indices. Does...

split()

String
instance

Splits a string into an array of substrings using a separator. The separator can be a string or...

startsWith()

String
instance

Checks if the string starts with the given characters. The optional position lets you check from...

substring()

String
instance

Returns the part of the string between two indices. Similar to slice() but treats negative...

toLocaleLowerCase()

String
instance

Returns this string converted to lower case, according to any locale-specific case mappings.

toLocaleUpperCase()

String
instance

Returns this string converted to upper case, according to any locale-specific case mappings.

toLowerCase()

String
instance

Returns this string converted to lower case.

toString()

String
instance

Returns the primitive string value. Useful when you are working with a String object wrapper.

toUpperCase()

String
instance

Returns this string converted to upper case.

toWellFormed()

String
instance

Returns a string where all lone surrogates of this string are replaced with the Unicode...

trim()

String
instance

Removes whitespace from both ends of a string and returns a new string, without modifying the...

trimEnd()

String
instance

Removes whitespace from the end of a string and returns a new string, without modifying the...

trimStart()

String
instance

Removes whitespace from the beginning of a string and returns a new string, without modifying...

valueOf()

String
instance

Returns the primitive value of a String object.

[Symbol.iterator]()

String
instance

Returns an Iterator object for iterating over the code points of the string, returning each code...

toExponential()

Number
instance

Formats a number in scientific/exponential notation (e.g., 1.23e+4 means 1.23 × 10⁴). Useful for...

toFixed()

Number
instance

Formats a number with exactly the specified number of decimal places. Rounds if needed. Returns...

toLocaleString()

Number
instance

Returns a locale-specific string representation of the number (e.g., formatted with commas or...

toPrecision()

Number
instance

Returns a string representing the number to the given precision (significant digits, 1-21; uses...

toString()

Number
instance

Converts a number to a string. Optionally specify a base (radix) for binary, hex, octal, etc.

valueOf()

Number
instance

Returns the primitive number value of the Number object.

toString()

Boolean
instance

Converts a boolean to its string representation: "true" or "false".

valueOf()

Boolean
instance

Returns the primitive boolean value. Rarely needed since JavaScript auto-converts, but important...

hasOwnProperty()

Object
instance

Returns `true` if the object has the given property as its own (ignores the prototype chain),...

isPrototypeOf()

Object
instance

Returns `true` if the object is in the prototype chain of the given object, otherwise `false`.

propertyIsEnumerable()

Object
instance

Returns `true` if the given property is enumerable, otherwise `false`.

toLocaleString()

Object
instance

Returns a locale-specific string representation of the object.

toString()

Object
instance

Returns a string representation of the object.

valueOf()

Object
instance

Returns the object's primitive value. For plain objects, this is usually the object itself.

[Symbol.hasInstance]

Object
instance

Customizes the `instanceof` operator by defining how to check if an object is an instance of a...

[Symbol.isConcatSpreadable]

Object
instance

Determines if the object should be flattened when used with `Array.prototype.concat`.

[Symbol.iterator]()

Object
instance

Returns an iterator for iterating over the object's values.

[Symbol.match]

Object
instance

Customizes the behavior of `String.prototype.match` when the object is used as a RegExp-like...

[Symbol.replace]

Object
instance

Customizes the behavior of `String.prototype.replace` when the object is used as a RegExp-like...

[Symbol.search]

Object
instance

Customizes the behavior of `String.prototype.search` when the object is used as a RegExp-like...

[Symbol.species]

Object
instance

Specifies a constructor to use for derived objects.

[Symbol.split]

Object
instance

Customizes the behavior of `String.prototype.split` when the object is used as a RegExp-like...

[Symbol.toPrimitive]

Object
instance

Returns a primitive value representation of the object, given a hint.

[Symbol.toStringTag]

Object
instance

Provides a string tag for the object, used in `toString`.

[Symbol.unscopables]

Object
instance

Returns an object whose properties are excluded from the `with` environment bindings.

getDate()

Date
instance

Returns the day of the month (1-31) for the date.

getDay()

Date
instance

Returns the day of the week (0-6, where 0 is Sunday) for the date.

getFullYear()

Date
instance

Returns the four-digit year for the date.

getHours()

Date
instance

Returns the hour (0-23) for the date.

getMilliseconds()

Date
instance

Returns the milliseconds (0-999) for the date.

getMinutes()

Date
instance

Returns the minutes (0-59) for the date.

getMonth()

Date
instance

Returns the month (0-11) for the date.

getSeconds()

Date
instance

Returns the seconds (0-59) for the date.

getTime()

Date
instance

Returns the number of milliseconds since the Unix epoch for the date.

getTimezoneOffset()

Date
instance

Returns the time zone difference in minutes from UTC for the date.

getUTCDate()

Date
instance

Returns the day of the month (1-31) for the UTC date.

getUTCDay()

Date
instance

Returns the day of the week (0-6) for the UTC date.

getUTCFullYear()

Date
instance

Returns the four-digit year for the UTC date.

getUTCHours()

Date
instance

Returns the hour (0-23) for the UTC date.

getUTCMilliseconds()

Date
instance

Returns the milliseconds (0-999) for the UTC date.

getUTCMinutes()

Date
instance

Returns the minutes (0-59) for the UTC date.

getUTCMonth()

Date
instance

Returns the month (0-11) for the UTC date.

getUTCSeconds()

Date
instance

Returns the seconds (0-59) for the UTC date.

setDate()

Date
instance

Sets the day of the month for the date and returns the new timestamp (adjusts month/year if needed).

setFullYear()

Date
instance

Sets the year (and optional month/day) for the date and returns the new timestamp.

setHours()

Date
instance

Sets the hours (and optional minutes/seconds/milliseconds) for the date and returns the new...

setMilliseconds()

Date
instance

Sets the milliseconds for the date and returns the new timestamp.

setMinutes()

Date
instance

Sets the minutes (and optional seconds/milliseconds) for the date and returns the new timestamp.

setMonth()

Date
instance

Sets the month (and optional day) for the date and returns the new timestamp (adjusts year if...

setSeconds()

Date
instance

Sets the seconds (and optional milliseconds) for the date and returns the new timestamp.

setTime()

Date
instance

Sets the date to the given timestamp (milliseconds since epoch) and returns the new timestamp.

setUTCDate()

Date
instance

Sets the UTC day of the month for the date and returns the new timestamp.

setUTCFullYear()

Date
instance

Sets the UTC year (and optional month/day) for the date and returns the new timestamp.

setUTCHours()

Date
instance

Sets the UTC hours (and optional minutes/seconds/milliseconds) for the date and returns the new...

setUTCMilliseconds()

Date
instance

Sets the UTC milliseconds for the date and returns the new timestamp.

setUTCMinutes()

Date
instance

Sets the UTC minutes (and optional seconds/milliseconds) for the date and returns the new timestamp.

setUTCMonth()

Date
instance

Sets the UTC month (and optional day) for the date and returns the new timestamp.

setUTCSeconds()

Date
instance

Sets the UTC seconds (and optional milliseconds) for the date and returns the new timestamp.

toDateString()

Date
instance

Returns a string representing the date portion in the local timezone (e.g., "Tue Nov 21 2023").

toISOString()

Date
instance

Returns a string representing the date in ISO 8601 format (UTC, e.g., "2023-11-21T12:34:56.789Z").

toJSON()

Date
instance

Returns a JSON-safe string representation of the date (equivalent to `toISOString()` for...

toLocaleDateString()

Date
instance

Returns a locale-specific string representing the date portion (e.g., "11/21/2023" in en-US).

toLocaleString()

Date
instance

Returns a locale-specific string representing the full date and time.

toLocaleTimeString()

Date
instance

Returns a locale-specific string representing the time portion (e.g., "12:34:56 PM").

toString()

Date
instance

Returns a string representing the full date and time in the local timezone...

toTimeString()

Date
instance

Returns a string representing the time portion in the local timezone (e.g., "12:34:56 GMT-0500...

toUTCString()

Date
instance

Returns a string representing the date in UTC (RFC 1123 format, e.g., "Tue, 21 Nov 2023 17:34:56...

valueOf()

Date
instance

Returns the primitive timestamp value (milliseconds since epoch) of the Date object (same as...

dotAll

RegExp
instance

Returns `true` if the dot (`.`) matches newlines (`s` flag), otherwise `false`.

flags

RegExp
instance

A string with the flags of the RegExp (e.g., "gi").

global

RegExp
instance

Returns `true` if the `g` flag is set (matches all occurrences), otherwise `false`.

hasIndices

RegExp
instance

Returns `true` if the `d` flag is set (provides match indices), otherwise `false`.

ignoreCase

RegExp
instance

Returns `true` if the `i` flag is set (case-insensitive matching), otherwise `false`.

lastIndex

RegExp
instance

The index where to start the next match (used with global or sticky; writable).

multiline

RegExp
instance

Returns `true` if the `m` flag is set (treats `^` and `$` as line boundaries), otherwise `false`.

source

RegExp
instance

The source pattern of the RegExp (as a string, escaped for literal use).

sticky

RegExp
instance

Returns `true` if the `y` flag is set (matches starting at `lastIndex` only), otherwise `false`.

unicode

RegExp
instance

Returns `true` if the `u` flag is set (enables Unicode features like full code point support),...

[Symbol.match]()

RegExp
instance

Customizes the behavior when the RegExp is used with `String.prototype.match` (returns matches...

[Symbol.matchAll]()

RegExp
instance

Customizes the behavior when the RegExp is used with `String.prototype.matchAll` (returns an...

[Symbol.replace]()

RegExp
instance

Customizes the behavior when the RegExp is used with `String.prototype.replace` (replaces matches).

[Symbol.search]()

RegExp
instance

Customizes the behavior when the RegExp is used with `String.prototype.search` (returns index of...

[Symbol.split]()

RegExp
instance

Customizes the behavior when the RegExp is used with `String.prototype.split` (splits on matches).

exec()

RegExp
instance

Executes the RegExp on the given string, returning an array of match details (including groups...

test()

RegExp
instance

Tests the string against the RegExp, returning true if there is a match or false otherwise;...

toString()

RegExp
instance

Returns a string representation of the RegExp (e.g., `/pattern/flags`).

size

Map
instance

A read-only property representing the number of key-value pairs in the Map.

clear()

Map
instance

Removes all key-value pairs from the Map (changes the original).

delete()

Map
instance

Removes the given key and its value from the Map (returns `true` if successful, `false` if key...

forEach()

Map
instance

Runs a given function once for each key-value pair (callback receives value, key, and Map as...

get()

Map
instance

Returns the value associated with the given key, or `undefined` if the key doesn't exist.

has()

Map
instance

Returns `true` if the Map contains the given key, otherwise `false`.

keys()

Map
instance

Returns an Iterator object for iterating over the keys in the order they were added.

set()

Map
instance

Adds or updates the key-value pair in the Map and returns the Map itself (mutates original;...

values()

Map
instance

Returns an Iterator object for iterating over the values in the order they were added.

entries()

Map
instance

Returns an Iterator object for iterating over key-value pairs in the order they were added.

[Symbol.iterator]()

Map
instance

Returns an Iterator object for iterating over key-value pairs in the order they were added (lets...

[Symbol.toStringTag]

Map
instance

Provides the string tag "Map", which is used by `Object.prototype.toString.call(...)`.

size

Set
instance

A read-only property representing the number of values in the Set.

add()

Set
instance

Appends the given value to the Set (if not already present) and returns the Set itself (mutates...

clear()

Set
instance

Removes all values from the Set (changes the original).

delete()

Set
instance

Removes the given value from the Set (returns `true` if successful, `false` if value not found;...

forEach()

Set
instance

Runs a given function once for each value (callback receives value, same value as key, and Set...

has()

Set
instance

Returns `true` if the Set contains the given value, otherwise `false`.

keys()

Set
instance

Returns an Iterator object for iterating over the values in the order they were added (identical...

values()

Set
instance

Returns an Iterator object for iterating over the values in the order they were added.

entries()

Set
instance

Returns an Iterator object for iterating over [value, value] pairs in the order they were added...

[Symbol.iterator]()

Set
instance

Returns an Iterator object for iterating over the values in the order they were added (lets you...

[Symbol.toStringTag]

Set
instance

Provides the string tag "Set", which is used by `Object.prototype.toString.call(...)`.

catch()

Promise
instance

Handles errors from the Promise chain. Like a try/catch for promises. Returns a new Promise so...

finally()

Promise
instance

Runs cleanup code no matter if the promise succeeds or fails. The handler receives no arguments...

then()

Promise
instance

The main way to handle Promise results. Chain .then() calls to process data step by step. Each...