Contact Free trial Login

typeOf

typeOf(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" ]

Was this article helpful?

💙 Thanks for your feedback!

Edit on GitHub