%dw 2.0
output application/json
import * from dw::core::Types
type AFunction = (String, Number) -> Number
type AFunction2 = () -> Number
---
{
a: functionReturnType(AFunction),
b: functionReturnType(AFunction2)
}
functionReturnType
functionReturnType(t: Type): Type | Null
Returns the type of a function’s return type. This function fails if the input type is not a Function type.
Introduced in DataWeave version 2.3.0.
Example
This example shows how functionReturnType
behaves with different inputs.