Skip to content

Function inspectArray() ​

inspectArray(array: unknown[], options?: InspectionOptions): string

Source: inspect.ts

Returns a string representation of an array.

Parameters ​

array ​

unknown[]

The array to inspect.

options? ​

InspectionOptions

Optional inspection options.

Returns ​

string

The resulting string.

Example ​

Note: The following examples omit or shorten the options parameter for simplicity. In reality, the return values will contain ANSI escape codes unless you explicitly set colors to false.

ts
inspect([1, 2, 3]) === "[1, 2, 3]"
inspect([1, 2, 3], { spaceAfterComma: false }) === "[1,2,3]"

Built by Prozilla