Contact Us 1-800-596-4880

typeOf

typeOf<T>(value: T): Type<T>

Returns the type of a value.

Parameters

Name Description

value

A string, object, array, number, or other supported type.

Example

This example identifies the type of several input values.

Source

%dw 2.0
output application/json
---
[ typeOf("A b"), typeOf([1,2]), typeOf(34), typeOf(true), typeOf({ a : 5 }) ]

Output

[ "String", "Array", "Number", "Boolean", "Object" ]