type

utility

Returns the type name of a value

Syntax

type(value)

Parameters

value (any)

The value to check the type of

Returns

string

The type name (e.g., "number", "string", "array", "object", "null", "boolean")

Examples

Check type of a number
Input:
123 | type
Output:
"number"
Check type of a string
Input:
"hello" | type
Output:
"string"
Add type information to data
Input:
map({field: .value, type: (.value | type)})
Output:
[{field: 42, type: "number"}]

The type() function returns a string representing the type of a value.

Usage

Use type() to validate data types, filter by type, or debug data processing pipelines.

Related Functions