JavaScript Globals
The standard JavaScript functions and objects an expression can use (Math, JSON, text, numbers, lists, objects, dates, regular expressions, Intl), with what each returns, and the Node APIs that do not exist.
Expressions run on Node 22 in an isolated context: the ECMAScript standard library is there, Node is not (no require, process, network or timers). Methods marked Node 22 are recent additions. Every example was run against the deployed engine over the example context at the end of the page.
Global functions
Standard ECMAScript functions available without a namespace: URL encoding and number parsing.
encodeURIComponent(text)
→ string Encodes a value for safe use inside one URL component (a query value or path segment), escaping &, =, /, ? and spaces.
decodeURIComponent(text)
→ string Decodes text produced by encodeURIComponent; throws URIError on a malformed % sequence.
encodeURI(text)
→ string Encodes a complete URL but keeps reserved characters such as :, /, ? and &; do not use it for single parameter values.
decodeURI(text)
→ string Decodes a complete URL encoded with encodeURI; escapes that stand for reserved characters stay encoded.
parseInt(text, radix?)
→ number Reads the leading integer of a text and stops at the first invalid character; always pass the radix (10), and expect NaN when the text does not start with a digit.
parseFloat(text)
→ number Reads the leading decimal number of a text; only . is accepted as decimal separator, so "1.234,5" becomes 1.234.
isNaN(value)
→ boolean Returns true when the value is NaN after being coerced to a number, so isNaN("abc") is true; use Number.isNaN for a check without coercion.
isFinite(value)
→ boolean Returns true when the value, coerced to a number, is finite (isFinite("12") is true); use Number.isFinite to avoid coercion.
Math
Static numeric functions and constants. Angles are in radians, and every function returns NaN when an argument is not numeric.
Math.E
→ number Euler's number, the base of natural logarithms (≈ 2.718).
Math.LN2
→ number Natural logarithm of 2 (≈ 0.693).
Math.LN10
→ number Natural logarithm of 10 (≈ 2.303).
Math.LOG2E
→ number Base-2 logarithm of e (≈ 1.443).
Math.LOG10E
→ number Base-10 logarithm of e (≈ 0.434).
Math.PI
→ number Ratio of a circle's circumference to its diameter (≈ 3.14159).
Math.SQRT1_2
→ number Square root of 1/2 (≈ 0.707).
Math.SQRT2
→ number Square root of 2 (≈ 1.414).
Math.abs(x)
→ number Absolute value of a number.
Math.acos(x)
→ number Arccosine in radians, for x between -1 and 1.
Math.acosh(x)
→ number Hyperbolic arccosine, for x greater than or equal to 1.
Math.asin(x)
→ number Arcsine in radians, for x between -1 and 1.
Math.asinh(x)
→ number Hyperbolic arcsine.
Math.atan(x)
→ number Arctangent in radians, between -π/2 and π/2.
Math.atan2(y, x)
→ number Angle in radians from the positive x axis to the point (x, y); note that y comes first.
Math.atanh(x)
→ number Hyperbolic arctangent, for x between -1 and 1.
Math.cbrt(x)
→ number Cube root; works with negative numbers.
Math.ceil(x)
→ number Rounds up to the next integer.
Math.clz32(x)
→ number Number of leading zero bits in the 32-bit unsigned representation of x.
Math.cos(x)
→ number Cosine of an angle in radians.
Math.cosh(x)
→ number Hyperbolic cosine.
Math.exp(x)
→ number e raised to the power x.
Math.expm1(x)
→ number e^x - 1, accurate for values of x close to 0.
Math.floor(x)
→ number Rounds down toward -Infinity, so Math.floor(-1.5) is -2.
Math.fround(x)
→ number Nearest 32-bit single-precision float to x.
Math.hypot(...values)
→ number Square root of the sum of the squares of its arguments.
Math.imul(a, b)
→ number 32-bit integer multiplication with overflow, as in C; useful for simple hash functions.
Math.log(x)
→ number Natural logarithm; -Infinity for 0 and NaN for negative numbers.
Math.log10(x)
→ number Base-10 logarithm.
Math.log1p(x)
→ number Natural logarithm of 1 + x, accurate for values of x close to 0.
Math.log2(x)
→ number Base-2 logarithm.
Math.max(...values)
→ number Largest of its arguments; spread an array with ..., and note it returns -Infinity with no arguments.
Math.min(...values)
→ number Smallest of its arguments; spread an array with ..., and note it returns Infinity with no arguments.
Math.pow(base, exponent)
→ number base raised to exponent, the same as the ** operator.
Math.random()
→ number Pseudo-random number in [0, 1); it changes on every run, so avoid it where the result must be reproducible and use $uuid for identifiers.
Math.round(x)
→ number Rounds to the nearest integer, with .5 going toward +Infinity (Math.round(-2.5) is -2); for two decimals use Math.round(x * 100) / 100.
Math.sign(x)
→ number Returns 1, -1, 0 or -0 according to the sign of x.
Math.sin(x)
→ number Sine of an angle in radians.
Math.sinh(x)
→ number Hyperbolic sine.
Math.sqrt(x)
→ number Square root; NaN for negative numbers.
Math.tan(x)
→ number Tangent of an angle in radians.
Math.tanh(x)
→ number Hyperbolic tangent, between -1 and 1.
Math.trunc(x)
→ number Drops the fractional part, rounding toward zero (Math.trunc(-1.5) is -1).
JSON
Convert between JSON text and values. Use it to read string payloads and to build request bodies.
JSON.parse(text, reviver?)
→ any Parses JSON text into a value; invalid JSON throws SyntaxError and the expression fails.
JSON.stringify(value, replacer?, indent?)
→ string Serializes a value to JSON text; drops undefined and functions, turns Map and Set into {}, writes dates as ISO text, and throws on circular references.
Number
Conversion, checks and formatting for numbers. Values that arrive as text (form fields, query strings, CSV) must be converted before doing arithmetic.
Number(value)
→ number Converts a value to a number: "" and null become 0 and any non-numeric text becomes NaN; unlike parseFloat, the whole text must be numeric.
Number.isFinite(value)
→ boolean Returns true only for finite values of type number, without coercion.
Number.isInteger(value)
→ boolean Returns true when the value is a number with no fractional part.
Number.isNaN(value)
→ boolean Returns true only when the value is exactly NaN, without coercion; use it after Number() to detect invalid input.
Number.isSafeInteger(value)
→ boolean Returns true for integers between ±(2^53 − 1); larger numeric ids lose precision, so keep them as text.
Number.parseFloat(text)
→ number Same function as the global parseFloat.
Number.parseInt(text, radix?)
→ number Same function as the global parseInt; always pass the radix.
Number.EPSILON
→ number Smallest difference between 1 and the next representable number (2^-52); use it as tolerance when comparing decimals.
Number.MAX_SAFE_INTEGER
→ number Largest integer that can be represented exactly (2^53 − 1 = 9007199254740991).
Number.MIN_SAFE_INTEGER
→ number Smallest integer that can be represented exactly (−(2^53 − 1)).
Number.MAX_VALUE
→ number Largest finite number (≈ 1.8e308).
Number.MIN_VALUE
→ number Smallest positive number greater than 0 (≈ 5e-324), not the most negative number.
Number.NaN
→ number The "not a number" value; it is not equal to itself, so test it with Number.isNaN.
Number.POSITIVE_INFINITY
→ number Positive infinity, larger than any number; handy as an "unlimited" default.
Number.NEGATIVE_INFINITY
→ number Negative infinity, smaller than any number; handy as the starting value when looking for a maximum.
number.toExponential(digits?)
→ string number Formats the number in exponential notation and returns text.
number.toFixed(digits?)
→ string number Formats with a fixed number of decimals and returns text, not a number; wrap it in Number() if you keep calculating.
number.toLocaleString(locale?, options?)
→ string number Formats the number with the separators of a locale (uses Intl.NumberFormat); pass the locale explicitly, since the default is the server's.
number.toPrecision(precision?)
→ string number Formats with a given number of significant digits and returns text; may switch to exponential notation.
number.toString(radix?)
→ string number Converts the number to text in the given base (2 to 36, default 10).
String
Text conversion and the methods available on every text value. Text is immutable: every method returns a new value and leaves the original unchanged.
String(value)
→ string Converts any value to text; null becomes "null" and objects become "[object Object]", so use JSON.stringify for objects.
String.fromCharCode(...codes)
→ string Builds text from UTF-16 code units.
String.fromCodePoint(...codePoints)
→ string Builds text from Unicode code points, including characters outside the basic plane such as emoji.
String.raw`template`
→ string Template tag that returns the text without processing backslash escapes; handy for regular expressions and Windows paths.
text.length
→ number text Number of UTF-16 code units in the text; an emoji can count as 2.
text.at(index)
→ string text Character at index; negative values count from the end, and out-of-range indexes return undefined.
text.charAt(index)
→ string text Character at index, or "" when the index is out of range.
text.charCodeAt(index)
→ number text UTF-16 code unit at index (0 to 65535), or NaN when out of range.
text.codePointAt(index)
→ number text Unicode code point that starts at index, or undefined when out of range.
text.concat(...texts)
→ string text Joins the arguments to the end of the text; the same as using +.
text.endsWith(search, length?)
→ boolean text Returns true when the text ends with search (case-sensitive).
text.includes(search, position?)
→ boolean text Returns true when search appears in the text; the comparison is case-sensitive, so normalize the case first.
text.indexOf(search, position?)
→ number text Index of the first occurrence of search, or -1 when it is not found.
text.isWellFormed()
→ boolean text Returns true when the text contains no lone surrogates, i.e. it can be safely encoded as UTF-8.
text.lastIndexOf(search, position?)
→ number text Index of the last occurrence of search, or -1 when it is not found.
text.localeCompare(other, locale?, options?)
→ number text Compares two texts by the rules of a locale and returns a negative number, 0 or a positive number; use it in sort to order names with accents correctly.
text.match(regexp)
→ list text Matches a regular expression: without the g flag it returns the first match with its groups, with g every match; returns null when nothing matches, so guard the result.
text.matchAll(regexp)
→ iterator text Iterator over every match, with groups, of a regex that must have the g flag; spread it into a list with [...].
text.normalize(form?)
→ string text Returns the Unicode normalization form (NFC by default); with NFD plus a regex you can strip accents.
text.padEnd(length, filler?)
→ string text Pads the end of the text with filler (a space by default) up to length.
text.padStart(length, filler?)
→ string text Pads the start of the text with filler (a space by default) up to length; typical for zero-padded codes.
text.repeat(count)
→ string text Repeats the text count times.
text.replace(pattern, replacement)
→ string text Replaces only the first match when pattern is text; use a regex with the g flag or replaceAll to replace every match. replacement can be a function or use $1 for groups.
text.replaceAll(pattern, replacement)
→ string text Replaces every match; when pattern is a regex it must have the g flag, otherwise it throws TypeError.
text.search(regexp)
→ number text Index of the first match of a regular expression, or -1.
text.slice(start, end?)
→ string text Extracts the part between start and end (exclusive); negative indexes count from the end.
text.split(separator, limit?)
→ list text Splits the text into a list by separator (text or regex).
text.startsWith(search, position?)
→ boolean text Returns true when the text starts with search (case-sensitive).
text.substring(start, end?)
→ string text Like slice, but negative indexes are treated as 0 and the arguments are swapped when start > end; prefer slice.
text.toLocaleLowerCase(locale?)
→ string text Converts to lowercase using the rules of a locale (for example Turkish dotted i).
text.toLocaleUpperCase(locale?)
→ string text Converts to uppercase using the rules of a locale.
text.toLowerCase()
→ string text Converts the text to lowercase; combine it with trim to normalize emails.
text.toUpperCase()
→ string text Converts the text to uppercase.
text.toWellFormed()
→ string text Returns a copy where every lone surrogate is replaced with U+FFFD, so the text can be encoded as UTF-8.
text.trim()
→ string text Removes whitespace and line breaks from both ends.
text.trimEnd()
→ string text Removes whitespace and line breaks from the end.
text.trimStart()
→ string text Removes whitespace and line breaks from the start.
Array
List creation and the methods available on every list. Mutating methods (sort, reverse, splice, push, pop, shift, unshift, fill, copyWithin) change the list in $json itself: copy it with [...list] first, or use the non-mutating versions (toSorted, toReversed, toSpliced, with).
Array.isArray(value)
→ boolean Reliable check for a list; use it instead of instanceof Array, which returns false for list literals written inside an expression.
Array.from(source, mapFn?)
→ list Creates a list from an iterable or array-like value (Set, Map, text, { length: n }), optionally mapping each element.
Array.of(...values)
→ list Creates a list from its arguments.
list.length
→ number list Number of elements in the list.
list.at(index)
→ any list Element at index; negative values count from the end (at(-1) is the last element).
list.concat(...values)
→ list list Returns a new list with the values (or the elements of lists) appended; does not mutate.
list.copyWithin(target, start, end?)
→ list list Mutates the list: copies a slice of it over another position and returns the same list.
list.entries()
→ iterator list Iterator of [index, element] pairs; spread it with [...] to get a list.
list.every(predicate)
→ boolean list Returns true when predicate is true for every element (and for an empty list).
list.fill(value, start?, end?)
→ list list Mutates the list: sets every position between start and end to value.
list.filter(predicate)
→ list list New list with the elements for which predicate returns true.
list.find(predicate)
→ any list First element that matches predicate, or undefined; combine it with ?. before reading a field.
list.findIndex(predicate)
→ number list Index of the first element that matches predicate, or -1.
list.findLast(predicate)
→ any list Last element that matches predicate, or undefined.
list.findLastIndex(predicate)
→ number list Index of the last element that matches predicate, or -1.
list.flat(depth?)
→ list list New list with nested lists flattened up to depth levels (1 by default).
list.flatMap(fn)
→ list list Maps each element and flattens the result one level; return a list to emit several values per element.
list.forEach(fn)
→ undefined list Runs fn for each element and returns undefined, so on its own the expression yields nothing; use map or reduce to produce a value.
list.includes(value, fromIndex?)
→ boolean list Returns true when the list contains value (finds NaN; objects are compared by reference, not by content).
list.indexOf(value, fromIndex?)
→ number list Index of the first element strictly equal to value, or -1.
list.join(separator?)
→ string list Joins the elements into text with separator (, by default); null and undefined become empty text.
list.keys()
→ iterator list Iterator of the indexes; spread it with [...] to get a list.
list.lastIndexOf(value, fromIndex?)
→ number list Index of the last element strictly equal to value, or -1.
list.map(fn)
→ list list New list with the result of calling fn on every element; to return an object literal from an arrow function, wrap it in parentheses.
list.pop()
→ any list Mutates the list: removes the last element and returns it; use at(-1) to read it without changing the list.
list.push(...values)
→ number list Mutates the list: appends the values and returns the new length, not the list; use concat or [...list, value] to get a new list.
list.reduce(fn, initial?)
→ any list Folds the list into a single value; always pass initial, because an empty list without it throws TypeError.
list.reduceRight(fn, initial?)
→ any list Like reduce, but from the last element to the first.
list.reverse()
→ list list Mutates the list: reverses it in place; use toReversed to get a reversed copy.
list.shift()
→ any list Mutates the list: removes the first element and returns it; use [0] or at(0) to read it without changing the list.
list.slice(start?, end?)
→ list list Copy of the part between start and end (exclusive) without mutating; negative indexes count from the end.
list.some(predicate)
→ boolean list Returns true when predicate is true for at least one element.
list.sort(compare?)
→ list list Mutates the list and, without compare, sorts the elements as text (10 comes before 9); pass (a, b) => a - b for numbers and copy first, or use toSorted.
list.splice(start, deleteCount?, ...items)
→ list list Mutates the list: removes deleteCount elements from start, inserts items, and returns the removed elements; use toSpliced to get a copy.
list.toLocaleString(locale?, options?)
→ string list Joins the elements with commas, formatting each one with its own toLocaleString.
list.toReversed()
→ list list Reversed copy of the list; does not mutate.
list.toSorted(compare?)
→ list list Sorted copy of the list; does not mutate. Without compare it also sorts as text.
list.toSpliced(start, deleteCount?, ...items)
→ list list Copy of the list with elements removed or inserted, like splice but without mutating.
list.toString()
→ string list Joins the elements with commas, the same as join(",").
list.unshift(...values)
→ number list Mutates the list: inserts the values at the start and returns the new length; use [value, ...list] to get a new list.
list.values()
→ iterator list Iterator of the elements; spread it with [...] to get a list.
list.with(index, value)
→ list list Copy of the list with the element at index replaced by value; does not mutate.
Object
Static functions to inspect, build and transform objects. Functions that freeze or redefine properties mutate their argument, so apply them to a copy ({ ...obj }) rather than to $json.
Object.assign(target, ...sources)
→ object Copies the own enumerable properties of sources into target, mutating it, and returns target; pass {} as target to get a new object.
Object.create(prototype, descriptors?)
→ object Creates an object with the given prototype; Object.create(null) gives a dictionary with no inherited keys.
Object.defineProperties(target, descriptors)
→ object Mutates target: defines several properties from descriptors; they are non-enumerable unless you set enumerable: true.
Object.defineProperty(target, key, descriptor)
→ object Mutates target: defines one property from a descriptor; it is non-enumerable by default, so JSON.stringify and Object.keys skip it.
Object.entries(value)
→ list List of [key, value] pairs of the own enumerable properties.
Object.freeze(value)
→ object Makes the object shallowly immutable and returns it; it freezes the argument itself, so freeze a copy, never $json.
Object.fromEntries(entries)
→ object Builds an object from a list of [key, value] pairs or a Map; the inverse of Object.entries.
Object.getOwnPropertyDescriptor(value, key)
→ object Descriptor (value, writable, enumerable, configurable, or get/set) of one own property, or undefined.
Object.getOwnPropertyDescriptors(value)
→ object Descriptors of every own property, keyed by property name.
Object.getOwnPropertyNames(value)
→ list Names of every own string key, including non-enumerable ones such as length on a list.
Object.getOwnPropertySymbols(value)
→ list Own symbol keys; workflow data parsed from JSON never has any.
Object.getPrototypeOf(value)
→ object Prototype of the object, or null.
Object.groupBy(items, keyFn)
→ object Node 22 Groups a list into an object whose keys are the results of keyFn and whose values are lists of matching elements.
Object.hasOwn(value, key)
→ boolean Returns true when the object has key as its own property (not inherited); safer than in or obj.hasOwnProperty.
Object.is(a, b)
→ boolean SameValue comparison: like ===, but NaN equals NaN and 0 differs from -0.
Object.isExtensible(value)
→ boolean Returns true when new properties can be added to the object.
Object.isFrozen(value)
→ boolean Returns true when the object is frozen.
Object.isSealed(value)
→ boolean Returns true when the object is sealed.
Object.keys(value)
→ list List of the own enumerable keys.
Object.preventExtensions(value)
→ object Mutates the object so no new properties can be added, and returns it.
Object.seal(value)
→ object Mutates the object so properties cannot be added or removed (existing ones stay writable), and returns it.
Object.setPrototypeOf(value, prototype)
→ object Mutates the object by replacing its prototype; rarely needed in expressions.
Object.values(value)
→ list List of the own enumerable values.
Boolean
Truthiness conversion. Flags that arrive as text must be compared explicitly, because any non-empty text is truthy.
Boolean(value)
→ boolean Converts a value to true or false: "", 0, NaN, null and undefined are false, while any non-empty text, including "false" and "0", is true; compare text flags with === "true".
Date
The native Date object. Prefer Luxon ($now, $today) for parsing, time zones and calendar arithmetic. Date local getters and setters use the server's time zone, not the user's, so use the UTC variants or pass a timeZone when formatting.
new Date(value?)
→ Date Creates a date from ISO text, a timestamp in milliseconds or parts; a date-only text ("2026-12-01") is read as UTC midnight, a date-time without offset as server time, and invalid input gives an Invalid Date.
Date.now()
→ number Current time as milliseconds since the Unix epoch.
Date.parse(text)
→ number Parses date text and returns its timestamp in milliseconds, or NaN when it cannot be parsed.
Date.UTC(year, monthIndex, day?, hours?, minutes?, seconds?, ms?)
→ number Timestamp in milliseconds for a UTC date built from parts; monthIndex starts at 0 (January is 0, December is 11).
date.getDate()
→ number date Day of the month (1–31) in the server's time zone.
date.getDay()
→ number date Day of the week (0 = Sunday to 6 = Saturday) in the server's time zone.
date.getFullYear()
→ number date Four-digit year in the server's time zone.
date.getHours()
→ number date Hour (0–23) in the server's time zone.
date.getMilliseconds()
→ number date Milliseconds (0–999) in the server's time zone.
date.getMinutes()
→ number date Minutes (0–59) in the server's time zone.
date.getMonth()
→ number date Month index (0 = January to 11 = December) in the server's time zone; add 1 for the calendar month.
date.getSeconds()
→ number date Seconds (0–59) in the server's time zone.
date.getTime()
→ number date Timestamp in milliseconds since the Unix epoch; NaN for an Invalid Date.
date.getTimezoneOffset()
→ number date Difference in minutes between UTC and the server's time zone, positive west of UTC (300 for UTC−5).
date.getUTCDate()
→ number date Day of the month (1–31) in UTC.
date.getUTCDay()
→ number date Day of the week (0 = Sunday to 6 = Saturday) in UTC.
date.getUTCFullYear()
→ number date Four-digit year in UTC.
date.getUTCHours()
→ number date Hour (0–23) in UTC.
date.getUTCMilliseconds()
→ number date Milliseconds (0–999) in UTC.
date.getUTCMinutes()
→ number date Minutes (0–59) in UTC.
date.getUTCMonth()
→ number date Month index (0 = January to 11 = December) in UTC.
date.getUTCSeconds()
→ number date Seconds (0–59) in UTC.
date.setDate(day)
→ number date Mutates the date: sets the day of the month in the server's time zone (overflow rolls into the next month) and returns the new timestamp in milliseconds; wrap it in new Date(...) to keep working with a date.
date.setFullYear(year, monthIndex?, day?)
→ number date Mutates the date: sets the year in the server's time zone and returns the new timestamp in milliseconds; wrap it in new Date(...) to keep working with a date.
date.setHours(hours, minutes?, seconds?, ms?)
→ number date Mutates the date: sets the time of day in the server's time zone and returns the new timestamp in milliseconds; wrap it in new Date(...) to keep working with a date.
date.setMilliseconds(ms)
→ number date Mutates the date: sets the milliseconds in the server's time zone and returns the new timestamp in milliseconds; wrap it in new Date(...) to keep working with a date.
date.setMinutes(minutes, seconds?, ms?)
→ number date Mutates the date: sets the minutes in the server's time zone and returns the new timestamp in milliseconds; wrap it in new Date(...) to keep working with a date.
date.setMonth(monthIndex, day?)
→ number date Mutates the date: sets the month index (0–11) in the server's time zone and returns the new timestamp in milliseconds; wrap it in new Date(...) to keep working with a date.
date.setSeconds(seconds, ms?)
→ number date Mutates the date: sets the seconds in the server's time zone and returns the new timestamp in milliseconds; wrap it in new Date(...) to keep working with a date.
date.setTime(timestamp)
→ number date Mutates the date: sets the whole date from a timestamp in milliseconds and returns the new timestamp in milliseconds; wrap it in new Date(...) to keep working with a date.
date.setUTCDate(day)
→ number date Mutates the date: sets the day of the month in UTC and returns the new timestamp in milliseconds; wrap it in new Date(...) to keep working with a date.
date.setUTCFullYear(year, monthIndex?, day?)
→ number date Mutates the date: sets the year in UTC and returns the new timestamp in milliseconds; wrap it in new Date(...) to keep working with a date.
date.setUTCHours(hours, minutes?, seconds?, ms?)
→ number date Mutates the date: sets the time of day in UTC and returns the new timestamp in milliseconds; wrap it in new Date(...) to keep working with a date.
date.setUTCMilliseconds(ms)
→ number date Mutates the date: sets the milliseconds in UTC and returns the new timestamp in milliseconds; wrap it in new Date(...) to keep working with a date.
date.setUTCMinutes(minutes, seconds?, ms?)
→ number date Mutates the date: sets the minutes in UTC and returns the new timestamp in milliseconds; wrap it in new Date(...) to keep working with a date.
date.setUTCMonth(monthIndex, day?)
→ number date Mutates the date: sets the month index (0–11) in UTC and returns the new timestamp in milliseconds; wrap it in new Date(...) to keep working with a date.
date.setUTCSeconds(seconds, ms?)
→ number date Mutates the date: sets the seconds in UTC and returns the new timestamp in milliseconds; wrap it in new Date(...) to keep working with a date.
date.toDateString()
→ string date Date part as English text in the server's time zone ("Fri Nov 20 2026").
date.toISOString()
→ string date ISO 8601 text in UTC ("2026-11-20T14:30:00.000Z"); throws RangeError for an Invalid Date.
date.toJSON()
→ string date Same as toISOString, but returns null for an Invalid Date; JSON.stringify calls it.
date.toLocaleDateString(locale?, options?)
→ string date Date part formatted for a locale; pass timeZone in options to avoid the server's zone.
date.toLocaleString(locale?, options?)
→ string date Date and time formatted for a locale; pass timeZone in options to avoid the server's zone.
date.toLocaleTimeString(locale?, options?)
→ string date Time part formatted for a locale; pass timeZone in options to avoid the server's zone.
date.toString()
→ string date Full English text with the server's time zone; not meant for storage or exchange.
date.toTimeString()
→ string date Time part as text with the server's time zone.
date.toUTCString()
→ string date RFC 7231 text in UTC ("Fri, 20 Nov 2026 14:30:00 GMT"), the format of HTTP headers.
RegExp
Regular expressions, written as literals (/ORD-\d+/i) or built with RegExp. The text methods that take a pattern (match, matchAll, replace, replaceAll, search, split) are listed under String.
new RegExp(pattern, flags?)
→ RegExp Builds a regular expression from text, for patterns that include dynamic values; escape special characters that come from data, and double the backslashes inside the text.
regexp.test(text)
→ boolean regex Returns true when the text matches; with the g or y flag it advances lastIndex, so repeated calls on the same regex can alternate results.
regexp.exec(text)
→ list regex Returns the first match as a list (full match, then groups) with index and named groups in .groups, or null when nothing matches.
Map and Set
Keyed collections (Map) and collections of unique values (Set). Both serialize as {}, so convert the result with Object.fromEntries, Array.from or [...] before the expression returns.
new Map(entries?)
→ Map Creates a map from [key, value] pairs; keys can be of any type and keep insertion order.
Map.groupBy(items, keyFn)
→ Map Node 22 Groups a list into a Map whose keys are the results of keyFn; unlike Object.groupBy, keys are not converted to text.
map.get(key)
→ any map Value stored under key, or undefined.
map.set(key, value)
→ Map map Mutates the map: stores value under key and returns the map, so calls can be chained.
map.has(key)
→ boolean map Returns true when the map contains key.
map.delete(key)
→ boolean map Mutates the map: removes key and returns true if it existed.
map.clear()
→ undefined map Mutates the map: removes every entry.
map.size
→ number map Number of entries in the map.
map.keys()
→ iterator map Iterator of the keys in insertion order; spread it with [...].
map.values()
→ iterator map Iterator of the values in insertion order; spread it with [...].
map.entries()
→ iterator map Iterator of [key, value] pairs; pass it to Object.fromEntries to get an object.
map.forEach(fn)
→ undefined map Runs fn(value, key) for each entry and returns undefined.
new Set(values?)
→ Set Creates a set of unique values (objects are compared by reference); spread it with [...] to deduplicate a list.
set.add(value)
→ Set set Mutates the set: adds value and returns the set, so calls can be chained.
set.has(value)
→ boolean set Returns true when the set contains value; faster than includes on large lists.
set.delete(value)
→ boolean set Mutates the set: removes value and returns true if it existed.
set.clear()
→ undefined set Mutates the set: removes every value.
set.size
→ number set Number of unique values in the set.
set.values()
→ iterator set Iterator of the values in insertion order; spread it with [...].
set.keys()
→ iterator set Same as values(); it exists for symmetry with Map.
set.entries()
→ iterator set Iterator of [value, value] pairs, for symmetry with Map.
set.forEach(fn)
→ undefined set Runs fn(value) for each value and returns undefined.
set.union(other)
→ Set set Node 22 New set with the values of both sets.
set.intersection(other)
→ Set set Node 22 New set with the values present in both sets.
set.difference(other)
→ Set set Node 22 New set with the values of this set that are not in other.
set.symmetricDifference(other)
→ Set set Node 22 New set with the values that are in exactly one of the two sets.
set.isSubsetOf(other)
→ boolean set Node 22 Returns true when every value of this set is in other.
set.isSupersetOf(other)
→ boolean set Node 22 Returns true when every value of other is in this set.
set.isDisjointFrom(other)
→ boolean set Node 22 Returns true when the two sets have no values in common.
Intl
Locale-aware formatting with full ICU data, so every locale and time zone is available. Always pass the locale, and for dates the timeZone, because the defaults are the server's.
new Intl.NumberFormat(locale?, options?).format(value)
→ string Formats numbers, currencies (style: "currency", currency), percentages (style: "percent") and units for a locale.
new Intl.DateTimeFormat(locale?, options?).format(date)
→ string Formats a Date for a locale (dateStyle, timeStyle or individual fields); pass timeZone, otherwise the server's zone is used.
new Intl.RelativeTimeFormat(locale?, options?).format(value, unit)
→ string Formats a relative time such as "in 3 days" or "2 hours ago"; with numeric: "auto" it uses words like "yesterday".
new Intl.ListFormat(locale?, options?).format(list)
→ string Joins a list of texts with the locale's conjunction ("a, b y c") or disjunction (type: "disjunction").
new Intl.PluralRules(locale?, options?).select(count)
→ string Returns the plural category of a number for a locale ("one", "other", …), to pick the right word form.
new Intl.Collator(locale?, options?).compare
→ function Locale-aware comparison function for sort; sensitivity: "base" ignores case and accents.
Not available
| Name | Instead |
|---|---|
require | There is no module system. Use the built-ins on this page, lodash as _, or a Code node (code.js) for logic that needs more. |
process | Not defined. Pass the values you need from the trigger or a previous node and read them from $json. |
Buffer | Not defined. Use $base64Encode / $base64Decode for Base64, and a Code node for binary data. |
atob | Not defined. Use $base64Decode(text). |
btoa | Not defined. Use $base64Encode(text). |
setTimeout | Not defined: expressions are synchronous and limited to 100 ms. Use a flow.wait node to pause a workflow. |
setInterval | Not defined. For repeated runs use a cron.trigger trigger; for retries, the node's retry settings. |
fetch | Not defined: expressions cannot make network calls. Use an io.http node and read its output in the next node. |
structuredClone | Not defined. Use _.cloneDeep(value), or JSON.parse(JSON.stringify(value)) for plain JSON data. |
URL | Not defined. Build URLs with encodeURIComponent and read their parts with split or a regular expression. |
URLSearchParams | Not defined. Use $toQueryString(object) to build a query string, or Object.entries with encodeURIComponent. |
TextEncoder | Not defined. Text is handled as JavaScript strings; use a Code node when you need UTF-8 bytes. |
TextDecoder | Not defined. Decode bytes in a Code node, or use $base64Decode for Base64 text. |
crypto | Not defined. Use $uuid for unique identifiers. |
async / await | Expressions are synchronous: await is a syntax error and an async function returns a Promise that is never awaited (it becomes {} in text). Do asynchronous work in a node. |
console.log | Accepted but discarded, and console.error / console.warn do not exist. To inspect a value, return it from the expression and check the node's output in the run. |
Example context
The examples of this page run over this input as $json. They do not change it: each example runs in a fresh context.
{
"$json": {
"body": {
"email": " Ana.Perez@Example.com ",
"name": "ana pérez",
"order_id": "ORD-1042",
"created_at": "2026-11-20T14:30:00Z",
"due_date": "2026-12-01",
"total": "1234.5",
"amount": 1234.567,
"qty": "3",
"discount": 0.15,
"status": "paid",
"phone": "+57 300 123 4567",
"tags": [
"vip",
"b2b",
"vip"
],
"key": "a b&c",
"url": "https://example.com/orders?id=ORD-1042&page=2",
"query": "name=Ana%20P%C3%A9rez",
"payload": "{\"sku\":\"SKU-1\",\"qty\":2}",
"note": "Line 1\nLine 2",
"code": "abc-123",
"score": 0.8734,
"lat": 4.711,
"lon": -74.0721,
"count": 42,
"radius": 2,
"paid": "true",
"retries": 2
},
"items": [
{
"sku": "SKU-1",
"name": "Keyboard",
"qty": 2,
"price": 45.5,
"category": "hardware"
},
{
"sku": "SKU-2",
"name": "Mouse",
"qty": 1,
"price": 19.99,
"category": "hardware"
},
{
"sku": "SKU-3",
"name": "Support plan",
"qty": 1,
"price": 120,
"category": "services"
}
],
"customer": {
"id": "cus_001",
"email": "ana@example.com",
"country": "CO"
},
"matrix": [
[
1,
2
],
[
3,
4
]
]
}
}