typeOf

typeOf(x)

Try it yourself:


typeOf(): identify a value type

typeOf(x) reports the type of x, such as number, string, array, matrix, or unit. It is helpful when formulas receive varied inputs.

Validate before processing

Type inspection prevents applying numeric operations to text or treating a scalar as a collection. Pair it with isNumeric(), isInteger(), and size() for more precise checks.

Related utilities

Use clone() to copy structured data, parse() to turn text into expressions, and format() to create output.

Caveat

A type check does not prove a value is valid for every operation; also validate shape, range, and unit compatibility.

All functions