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.

Try Type Of in Calcul.io

Start with one of the editable examples above, then replace its arguments with your own values. Keeping the function on a separate calculator line makes the input and result easy to compare. For a longer workflow, assign the result to a variable or reference that line in the next expression.

Check the shown signature before adding optional arguments, and use the related-function links to compare operations with similar purposes.

All functions