Function.From
Function.From(functionType as type,function as function) as function
采用一元函数 function
并创建一个类型为 functionType
的新函数,用于构造其参数列表,并将其传递给 function
。
示例:
将 List.Sum 转换为一个包含两个参数的函数,这两个参数一同添加
使用情况:
Function.From(type function (a as number, b as number) as number, List.Sum)(2, 1)
输出:
3
示例:
转换将列表更改为包含两个参数的函数的函数
使用情况:
Function.From(type function (a as text, b as text) as text, (list) => list{0} & list{1})("2", "1")
输出:
"21"