addDays | date | Adds days to a date. Returns a new Date — the original is never mutated. Returns null if the input is invalid. |
addMonths | date | Adds months to a date. Returns a new Date — the original is never mutated. When the resulting month has fewer days, JavaScript clamps to the next month (e.g. Jan 31 + 1 month → Mar 3). Use with caution. Returns null if the input is invalid. |
addYears | date | Adds years to a date. Returns a new Date — the original is never mutated. Returns null if the input is invalid. |
analyzeCommits | commit | Analyses a list of commits to suggest a semantic version bump. Each commit is parsed via parseConventionalCommit. The body is also scanned for BREAKING CHANGE: / BREAKING-CHANGE: markers. The bump rule is: - any breaking change → 'major' - otherwise any feat → 'minor' - otherwise any fix → 'patch' - otherwise (non-empty list of non-conventional commits) → 'patch' - empty list → 'patch' with reason “No commits to analyse” |
buildConventionalCommitRegex | commit | Builds a regular expression matching the subject line of a Conventional Commits message. The returned regex exposes four capture groups: 1. type 2. scope (or undefined when absent) 3. breaking marker ('!' or undefined) 4. description |
buildStatusTable | ci | Builds a Markdown table body from a map of job names to CI/CD statuses. Each row follows the format | icon | **Job Name** | badge |. Intended to be embedded in a PR comment template: | | Job | Status | |:---:|-----|:------:| ${buildStatusTable(jobs)} |
cartesianProduct | array | Computes the Cartesian product of the provided arrays. Returns all possible tuples formed by picking one element from each input array, in lexicographic order relative to the input order. |
clampDate | date | Clamps a date to a [min, max] range. Returns a new Date — the original is never mutated. Returns null if any of the inputs is invalid. |
compact | array | Removes all falsy values (false, null, undefined, 0, "", NaN) from an array. |
compact | object | Removes all entries with falsy values (false, null, undefined, 0, "", NaN) from an object. |
compare | date | Comparison of two dates. Accepts any DateLike input (Date, timestamp, or date string). |
compose | function | Composes functions right-to-left: compose(f, g)(x) is equivalent to f(g(x)). The inverse of pipe, which applies functions left-to-right. |
countBy | array | Groups the elements of an array by the key returned by keyFn and returns a record mapping each key to the number of matching elements. |
curry | function | Transforms a multi-argument function into a chain of single-argument functions (Haskell-style currying). Supports up to 5 arguments. The inverse operation of applying all arguments at once: curry(fn)(a)(b) is equivalent to fn(a, b). |
daysDifference | date | Gets the difference in days between two dates. |
daysInMonth | date | Returns the number of days in the given month of the given year. Month is 1-based (1 = January, 12 = December) to match human convention and ISO 8601 (unlike Date.getMonth() which is 0-based). Returns NaN if the month is out of range. |
defer | promise | Runs an async function and guarantees that all deferred callbacks are executed afterwards, in LIFO order (last registered = first executed), regardless of whether the main work succeeds or throws. Inspired by Radashi’s defer. Useful for resource cleanup, temporary file removal, or any “undo” logic that must run even on failure. |
diff | object | Structural object diff. Returns true when both inputs are deeply equal, otherwise a DiffResult describing the differences key by key. Comparison rules: - Same reference \u2192 true. - Either side is null/undefined (and not both) \u2192 false. - Both Date \u2192 epoch comparison. - Both arrays \u2192 compared with array/equalsDeep (leaf, no diff drill-down). - Special objects (Map, Set, RegExp, Promise, class instances\u2026) \u2192 reference equality. - Plain objects \u2192 key-by-key, recursing up to options.depth levels. - Mixed types (e.g. array vs object, Date vs object) \u2192 false. For a boolean wrapper see equalsDeep from this category. For a one-level boolean check see equalsShallow from this category. |
difference | date | Calculates the difference between two dates in the specified unit. Accepts any DateLike input (Date, timestamp, or date string). |
eachDay | date | Returns an array of Date objects for each day from start to end (inclusive). Both boundaries are included. If start > end, an empty array is returned. Returns an empty array if either input is invalid. |
eachMonth | date | Returns an array of Date objects for the first day of each month from start to end (inclusive). Each returned Date is normalized to the 1st of the month at 00:00:00.000. If start > end, an empty array is returned. Returns an empty array if either input is invalid. |
endOf | date | Returns a new Date set to the end of the given unit. - 'day' — 23:59:59.999 - 'month' — last day of the month, 23:59:59.999 - 'year' — December 31st, 23:59:59.999 Returns null if the input is invalid. |
ensureArray | array | Wraps a value in an array if it is not already one. If the value is already an array, it is returned as-is. If the value is null or undefined, returns an empty array. When a depth is specified, the resulting array is flattened to that depth (like Array.prototype.flat(depth)). |
ensureDate | date | Safely converts a date-like value to a valid Date object, or returns null. Accepts Date, timestamps (seconds or milliseconds, auto-detected), date strings, and objects with an epochMilliseconds property (e.g. Temporal.Instant, Temporal.ZonedDateTime). Returns null for null, undefined, empty strings, 0, and any value that produces an invalid Date. This is the date equivalent of ensureArray — it normalizes flexible input into a guaranteed type (or a safe fallback). |
equalsDeep | array | Recursive structural array equality. Two arrays are equal when they have the same length and each pair of elements at the same index is structurally equal: - Arrays recurse with equalsDeep. - Plain objects recurse key-by-key with structural comparison. - Date instances are compared by their epoch value. - All other values use strict equality (===), which means NaN !== NaN and special objects (Map, Set, RegExp, Promise, class instances\u2026) are compared by reference. For positional one-level comparison use equalsShallow. For order-independent comparison use equalsUnordered. |
equalsDeep | object | Recursive structural object equality. Boolean wrapper around diff \u2014 returns true when the two values are deeply equal according to the same rules. Use this when you only need a yes/no answer; use diff when you also need to know what differs. For a one-level boolean check use equalsShallow. |
equalsShallow | array | Positional, one-level (shallow) array equality. Two arrays are equal when they have the same length and each pair of elements at the same index satisfies strict equality (===). No recursion: nested arrays/objects are compared by reference. For recursive structural comparison use equalsDeep. For order-independent comparison use equalsUnordered. |
equalsShallow | object | One-level (shallow) object equality. Two objects are equal when they share the exact same set of own enumerable string keys and each pair of values satisfies strict equality (===). No recursion: nested objects/arrays are compared by reference. Falls back to strict equality when either input is null, undefined or not an object \u2014 so primitives match if and only if they are ===. Arrays are not supported; they always return false (unless identical references). Use array/equalsShallow instead. For recursive structural comparison use equalsDeep. For a diff structure use diff. |
equalsUnordered | array | Order-independent (set-style) array equality. Two arrays are considered equal when they have the same length and every element of arr1 has at least one structural match in arr2 (and vice versa via the length check). Nested arrays are compared recursively with the same order-independent semantics. Nested plain objects are compared with equalsShallow from object/. All other values use strict equality (===). Use this when the inputs represent unordered collections (sets, tags…). For positional equality use equalsShallow or equalsDeep from this category. |
escape | markdown | Escapes all Markdown special characters in a string so they render as literal text rather than formatting syntax. Escaped characters: \\ \\ * _ { } [ ] ( ) # + - . ! Pass{ cell: true }` to also escape pipe characters and replace newlines with spaces, making the result safe for embedding in a Markdown table cell. |
escapeHtml | string | Escapes the HTML special characters &, <, >, ", and ' in a string. Use this to safely embed untrusted content into HTML attribute values or text nodes without risk of XSS injection. |
flip | function | Creates a function that invokes fn with the first two arguments swapped. Useful when adapting a function for use in higher-order pipelines where the argument order is reversed (e.g. passing a binary callback to reduce). |
formatCompact | number | Formats a number using compact notation (e.g. 1_500_000 → "1.5M"). Thin wrapper over Intl.NumberFormat with notation: 'compact'. Companion of formatSize in the same format* family. |
formatDuration | date | Formats a duration in milliseconds as a compact human-readable string. Produces output like "1h 23m 45s". Zero-valued leading units are omitted (e.g. "23m 45s" instead of "0h 23m 45s"), but trailing zeros are kept up to the minimum unit ("1h 0m 0s" when minUnit is 'seconds'). Negative durations are prefixed with "-". A zero duration returns "0s" (or "0m" / "0h" depending on minUnit). |
formatInTimezone | date | Formats a date in a specific IANA timezone using Intl.DateTimeFormat. Returns null if the date or timezone is invalid. |
formatSize | number | Format a byte count into a human-readable string with the appropriate unit. Each unit is 1024 of the previous (binary prefix). The result is formatted with one decimal place. |
fromMillis | date | Creates a Date from a timestamp in milliseconds. Use this when receiving a timestamp from a JS-native source (e.g. Date.now(), performance.timeOrigin). No heuristic — the input is always treated as milliseconds. |
fromSeconds | date | Creates a Date from a timestamp in seconds. Use this when receiving a timestamp from a backend that sends seconds (e.g. Java Instant.getEpochSecond()). No heuristic — the input is always treated as seconds. |
getTimezoneOffset | date | Returns the UTC offset in minutes for the given IANA timezone at a specific point in time. A positive value means the timezone is ahead of UTC (e.g. +60 for CET). Returns null if the timezone is invalid or the date cannot be parsed. The implementation uses Intl.DateTimeFormat to extract the local representation in the target timezone, then computes the delta from UTC. |
groupBy | object | Groups an array of items by a key derived from each item. A thin, typed wrapper around Object.groupBy (ES2024) that works on older targets and provides stricter return-type inference. |
guard | promise | Wraps a function so that if it throws, a default value is returned instead of propagating the error. Works with both synchronous and asynchronous functions. |
identity | function | Returns the given value unchanged Useful as a default transform, in function composition, or as a placeholder mapper. |
injectWordBreaks | string | Adds word-break opportunities to a string so it can wrap cleanly in narrow UI containers such as side panels or table cells. Invisible zero-width spaces (\\u200B) are inserted at meaningful boundaries — camelCase splits, path separators, token edges — while protected spans (URLs, emails, HTML) and atomic numeric values (-0.1%, 12ms, 1e-3) are never broken. The visible text content is unchanged. |
inRange | number | Checks whether a number falls within [min, max] (both inclusive by default). |
invert | object | Returns a new object with keys and values swapped. If multiple keys share the same value, the last one wins. |
isArrayBuffer | type | Checks if a value is an ArrayBuffer instance. Useful for filtering or type-narrowing in a functional pipeline: values.filter(isArrayBuffer) |
isAsyncFunction | type | Checks if a value is an async function. Returns true for any function declared with async. |
isBigInt | type | Checks if a value is a bigint. |
isBlob | type | Checks if a value is a Blob instance. Useful for filtering or type-narrowing in a functional pipeline: values.filter(isBlob) |
isBuffer | node | Checks if a value is a Node.js Buffer instance. Buffer extends Uint8Array and is specific to Node.js, Bun, and Deno. In browser-only environments where Buffer is not defined, this function always returns false. Useful for filtering or type-narrowing in a functional pipeline: values.filter(isBuffer) |
isBusinessDay | date | Checks whether a date falls on a business day (i.e. not a weekend day). This is the logical inverse of isWeekend. By default, business days are Monday through Friday. Pass a custom weekendDays to adapt to other calendars. > Note: This helper does not account for public holidays — those are > country- and region-specific. Use it in combination with your own holiday > list if needed. Returns false if the input is invalid. |
isConventionalCommit | commit | Checks whether a commit message’s subject line follows the Conventional Commits format constrained by the given options. Only the first line is inspected — body and footer are ignored. |
isDate | type | Checks if a value is a Date instance. Note: this only checks the type, not whether the Date is valid. Use isValidDate to also validate that the Date is not Invalid Date. |
isDefined | type | Checks if a value is defined (not undefined nor null). This is the inverse of isNullish. Use as a type-safe filter callback to remove null/undefined from arrays. |
isEmpty | type | Checks if a value is empty. Supported types: - null / undefined → empty - string → length === 0 - array → length === 0 - Map / Set → size === 0 - plain object → no own enumerable properties |
isError | type | Checks if a value is an Error instance. |
isFalsy | type | Checks if a value is falsy (false, null, undefined, 0, "", NaN). |
isFormData | type | Checks if a value is a FormData instance. Useful for filtering or type-narrowing in a functional pipeline: values.filter(isFormData) |
isIterable | type | Checks if a value is iterable (has a Symbol.iterator method). Returns true for strings, arrays, Maps, Sets, generators, and any object implementing the iterable protocol. |
isLeapYear | date | Returns true if the given year is a leap year. A year is a leap year when it is divisible by 4, except century years which must also be divisible by 400. |
isMap | type | Checks if a value is a Map instance. |
isNegativeNumber | type | Checks if a value is a number less than 0. Returns false for NaN, 0, positive numbers, and non-number types. |
isNonEmptyArray | type | Checks if a value is a non-empty array (length > 0). |
isNonEmptyString | type | Checks if a value is a non-empty string (length > 0). |
isNull | type | Checks if a value is null. |
isNullish | type | Checks if a value is null or undefined (nullish). |
isPlainObject | type | Checks if a value is a plain object. A plain object is created by {}, new Object(), or Object.create(null). Returns false for arrays, Date, Map, Set, RegExp, class instances, etc. |
isPositiveNumber | type | Checks if a value is a number greater than 0. Returns false for NaN, 0, negative numbers, and non-number types. |
isPrerelease | version | Returns true when the version string has a prerelease suffix (i.e. contains a - after the core MAJOR.MINOR.PATCH). |
isPrimitive | type | Checks if a value is a JavaScript primitive. Primitive types: string, number, boolean, bigint, symbol, null, undefined. |
isPromise | type | Checks if a value is a Promise or a thenable. Returns true for any object that has .then() and .catch() methods, including native Promises and userland implementations. |
isRegExp | type | Checks if a value is a RegExp instance. |
isSameDay | date | Checks if two dates are the same day. Accepts any DateLike input (Date, timestamp, or date string). |
isSameMonth | date | Checks if two dates are in the same month (and year). Accepts any DateLike input (Date, timestamp, or date string). |
isSameYear | date | Checks if two dates are in the same year. Accepts any DateLike input (Date, timestamp, or date string). |
isSpecialObject | type | Determines if a value is a special object that should not have its properties compared deeply. Special objects include: Date, Function, Promise, Observable, RegExp, Error, Map, Set, WeakMap, WeakSet, etc. |
isSymbol | type | Checks if a value is a symbol. |
isTemporalDuration | type | Checks if a value is a Temporal.Duration. Uses instanceof when Temporal is available globally, and falls back to Symbol.toStringTag for environments without Temporal (e.g. browsers). |
isTemporalInstant | type | Checks if a value is a Temporal.Instant. Uses instanceof when Temporal is available globally, and falls back to Symbol.toStringTag for environments without Temporal (e.g. browsers). |
isTemporalPlainDate | type | Checks if a value is a Temporal.PlainDate. Uses instanceof when Temporal is available globally, and falls back to Symbol.toStringTag for environments without Temporal (e.g. browsers). |
isTemporalPlainDateTime | type | Checks if a value is a Temporal.PlainDateTime. Uses instanceof when Temporal is available globally, and falls back to Symbol.toStringTag for environments without Temporal (e.g. browsers). |
isTemporalPlainTime | type | Checks if a value is a Temporal.PlainTime. Uses instanceof when Temporal is available globally, and falls back to Symbol.toStringTag for environments without Temporal (e.g. browsers). |
isTemporalZonedDateTime | type | Checks if a value is a Temporal.ZonedDateTime. Uses instanceof when Temporal is available globally, and falls back to Symbol.toStringTag for environments without Temporal (e.g. browsers). |
isTimestamp | type | Checks if a value is a valid timestamp (milliseconds or Unix seconds). Supports: - JavaScript / Java timestamps (milliseconds since epoch) - Unix timestamps (seconds since epoch) The function uses a heuristic to distinguish between the two: numbers ≤ ~7.26 billion are treated as seconds, larger as milliseconds. |
isTruthy | type | Checks if a value is truthy (not false, null, undefined, 0, "", or NaN). This is the type-safe alternative to Boolean() as a filter callback. Unlike filter(Boolean), using filter(isTruthy) correctly narrows the resulting array type by excluding falsy values. |
isUndefined | type | Checks if a value is undefined. |
isValidDate | type | Checks if a value is a valid Date instance (not Invalid Date). Unlike isDate, this also verifies that the internal timestamp is not NaN. |
isValidDateString | date | Checks whether a string can be parsed into a valid Date. Uses the native Date constructor. Returns false for empty strings and any string that produces an Invalid Date. > Caveat: The native parser is lenient and implementation-dependent > for non-ISO formats. For strict format validation, prefer a dedicated > library or manual regex checks. |
isWeekend | date | Checks whether a date falls on a weekend day. By default, weekend days are Saturday and Sunday (Western convention). Pass a custom weekendDays tuple to adapt to other calendars (e.g. [5, 6] for Friday/Saturday in many Middle-Eastern countries). Returns false if the input is invalid. |
isWithinRange | date | Checks whether a date falls within a range (inclusive on both ends). Returns false if any of the inputs is invalid. |
leadingSentence | string | Extracts the leading sentence from a string. A sentence boundary is detected at the first occurrence of ., ?, !, …, or ; followed by whitespace or end of string. Newlines are collapsed to spaces before matching. If no boundary is found the entire (cleaned) string is returned. To cap the result at a maximum length, combine with truncate: ts truncate(leadingSentence(input), 120) |
lerp | number | Linearly interpolates between start and end by the factor t. - t = 0 returns start. - t = 1 returns end. - Values of t outside [0, 1] extrapolate beyond the range. |
listTimezones | date | Returns the list of IANA timezone identifiers supported by the runtime. Wraps Intl.supportedValuesOf('timeZone') which is available in Node 18+, Chrome 93+, Firefox 93+, Safari 15.4+. |
map | object | Transforms the values and/or keys of a plain object in a single pass. Both callbacks are optional and default to identity (no transformation). When mapValue is omitted the original values are preserved; when mapKey is omitted the original keys are preserved. Note: if two different keys map to the same output key the last one wins (insertion order). |
mean | number | Calculates the arithmetic mean (average) of an array of numbers. Returns NaN for an empty array. Pairs with sum for aggregate operations. |
negate | function | Creates a function that negates the result of predicate. |
noop | function | A no-operation function that does nothing and returns undefined Useful as a default callback, placeholder, or to explicitly ignore a value. |
omit | object | Creates a new object without the specified keys. |
once | function | Creates a function that is restricted to be called only once. Subsequent calls return the cached result of the first invocation. The returned function exposes a .reset() method to clear the cache and allow the original function to be called again. |
overlaps | date | Checks whether two date ranges overlap. Two ranges overlap when rangeA.start <= rangeB.end AND rangeB.start <= rangeA.end (inclusive on both ends). Returns false if any date is invalid. |
parallel | promise | Runs an array of async functions with a concurrency limit. At most limit functions will be running at any time. |
parse | version | Parses a semantic version string into its components according to SemVer 2.0.0 specification Supports: - Core version: MAJOR.MINOR.PATCH - Pre-release: -alpha, -beta.1, -rc.1, -0.3.7, -x.7.z.92 - Build metadata: +build, +sha.abc123, +20130313144700 - Optional ‘v’ prefix (commonly used in git tags) |
parseConventionalCommit | commit | Parses a Conventional Commits message into a structured object. The first line is matched against the regex produced by buildConventionalCommitRegex(options). The remaining content is split into a body and an optional trailing footer block (lines matching Token: value / Token #value, including BREAKING CHANGE: ...). |
parsePackageRepository | url | Parse the repository field from package.json into a structured object. Supports all npm-specified formats: - Object form: { "type": "git", "url": "...", "directory": "..." } - GitHub shorthand: "owner/repo" or "github:owner/repo" - Platform shorthands: "gitlab:owner/repo", "bitbucket:owner/repo" - Gist shorthand: "gist:<id>" - URL forms: git+https://, https://, git://, git@ SSH, git+ssh:// Returns undefined for null, undefined, arrays, or values that cannot be matched to any recognised format. |
partial | function | Partially applies arguments to a function, returning a new function that accepts the remaining arguments. |
partition | array | Splits an array into two groups based on a predicate function. The first group contains elements for which the predicate returns true, the second group contains the rest. |
pascalCase | string | Converts a string to PascalCase. Handles camelCase, kebab-case, snake_case, spaces, and mixed formats. |
pick | object | Creates a new object with only the specified keys. |
pipe | function | Composes functions left-to-right: the output of each function is passed as input to the next. The inverse of compose, which applies functions right-to-left. |
range | array | Generates an array of sequential numbers from start to end (exclusive). If only one argument is provided, it generates numbers from 0 to that value. |
resolveRecord | promise | Resolves an array of keys into a record by calling an async mapper for each key. All mapper calls run concurrently via Promise.all. Unlike parallel, which returns an array, resolveRecord preserves the key-to-value relationship in the result. |
safeFetch | promise | Wraps fetch with built-in error handling: returns null when the request fails (network error, non-OK status, or parse error) instead of throwing. |
safeJsonParse | object | Parses a JSON string, returning null (or a fallback) on any parse failure. Unlike JSON.parse, this never throws. Invalid JSON strings and other parsing edge-cases resolve to null or the provided fallback. |
sample | array | Picks one or more random elements from an array. When called without a count, returns a single element or undefined if the array is empty. When called with a count, returns an array of up to count random elements sampled without replacement. |
shuffle | array | Randomly reorders elements of an array using the Fisher-Yates algorithm. Returns a new array without mutating the original. |
slugify | string | Converts a string into a URL-friendly slug. |
snakeCase | string | Converts a string to snake_case. Handles camelCase, PascalCase, kebab-case, spaces, and mixed formats. |
startOf | date | Returns a new Date set to the start of the given unit. - 'day' — 00:00:00.000 - 'month' — 1st of the month, 00:00:00.000 - 'year' — January 1st, 00:00:00.000 Returns null if the input is invalid. |
statusToBadge | ci | Maps a CI/CD job status to an inline code badge string. | Status | Badge | |--------|-------| | success | `passing` | | failure | `failing` | | skipped | `skipped` | | (other) | `unknown` | |
statusToIcon | ci | Maps a CI/CD job status to an emoji icon. | Status | Icon | |--------|------| | success | ✅ | | failure | ❌ | | skipped | ⏭️ | | (other) | ⚠️ | |
stringify | version | Reconstruct a semantic version string from a ParsedVersion object. This is the inverse of parse: stringify(parse(v)) === stripV(v) for any valid SemVer string v. |
sum | number | Calculates the sum of an array of numbers. |
template | string | Interpolates {{key}} placeholders in a template string with values from a data record. Unknown keys are replaced with an empty string. No eval or Function constructor is used — substitution is purely regex-based. Nested expressions and logic are intentionally out of scope. |
timeAgo | date | Formats a date as a human-readable relative time string. Uses Intl.RelativeTimeFormat under the hood, making the output locale-aware (e.g. “il y a 3 jours” in French). Returns null if the input date is invalid. |
timeout | promise | Wraps a promise to reject with a TimeoutError if it does not resolve within the specified duration. |
titleCase | string | Converts a string to Title Case. Handles camelCase, PascalCase, kebab-case, snake_case, spaces, and mixed formats. |
toISO8601 | date | Converts a date to ISO 8601 format Format: YYYY-MM-DDTHH:mm:ss.sssZ |
toMillis | date | Converts a date to a timestamp in milliseconds (epoch millis). Use this when you need a plain number from a DateLike value (e.g. for Date.now() comparisons, localStorage, or JS-native APIs). |
toRFC2822 | date | Converts a date to RFC 2822 format Format: Day, DD Mon YYYY HH:mm:ss +0000 Used in email headers (Date field) and HTTP headers |
toRFC3339 | date | Converts a date to RFC 3339 format Format: YYYY-MM-DDTHH:mm:ssZ or YYYY-MM-DDTHH:mm:ss+HH:mm RFC 3339 is a profile of ISO 8601, but without milliseconds by default |
toSeconds | date | Converts a date to a timestamp in seconds (epoch seconds). Use this when sending a date to a backend API that expects seconds (e.g. Java Instant.getEpochSecond(), Python time.time()). |
truncate | string | Truncates a string to maxLength characters, appending an ellipsis when cut. The ellipsis counts toward maxLength, so the result is always at most maxLength characters long. If the string is already within the limit, it is returned unchanged (no ellipsis appended). null and undefined inputs are returned as-is to align with other string helpers. |
tryit | promise | Wraps a function so it never throws. Instead, it returns a [error, result] tuple. Useful for avoiding try/catch blocks and handling errors in a functional style. |
unzip | array | Splits an array of tuples into separate arrays, one per position. The inverse of zip. |
uuid7 | id | Generates a UUID v7 string (RFC 9562). UUID v7 embeds a Unix timestamp in milliseconds, making it chronologically sortable while retaining randomness. |
WeekDays | date | Named day-of-week constants following the JavaScript Date.getDay() convention. Use these instead of raw numbers for readability. |
without | array | Returns a new array with all occurrences of the given values removed. Unlike difference, which operates on two arrays as set operands, without uses a variadic API suited for removing known sentinel values inline. Uses SameValueZero equality (same as Array.prototype.includes). |
words | string | Splits a string into an array of words. Handles camelCase, PascalCase, SCREAMING_SNAKE_CASE, kebab-case, snake_case, and regular whitespace-separated text. Numbers are treated as word tokens. |
zip | array | Combines multiple arrays element-by-element into an array of tuples. The result length equals the length of the shortest input array. The inverse of unzip. |