Training
Module
Develop typed functions by using TypeScript - Training
Learn how to develop typed functions by using TypeScript.
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
Function.From(functionType as type, function as function) as function
Takes a unary function function
and creates a new function with the type functionType
that constructs a list out of its arguments and passes it to function
.
Converts List.Sum into a two-argument function whose arguments are added together.
Usage
Function.From(type function (a as number, b as number) as number, List.Sum)(2, 1)
Output
3
Converts a function taking a list into a two-argument function.
Usage
Function.From(type function (a as text, b as text) as text, (list) => list{0} & list{1})("2", "1")
Output
"21"
Training
Module
Develop typed functions by using TypeScript - Training
Learn how to develop typed functions by using TypeScript.