Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/typescript/8.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript 创建包装函数以接受内部函数的变量参数_Javascript_Typescript - Fatal编程技术网

Javascript 创建包装函数以接受内部函数的变量参数

Javascript 创建包装函数以接受内部函数的变量参数,javascript,typescript,Javascript,Typescript,我正在创建一个包装函数,将参数传递给某个内部函数调用。内部函数具有接收可选参数的选项 实际功能 filterByColumn( fieldName: string, predicate?: string, matchCase?: boolean, actualOperator?: string ) { } 包装器 wrapperFunc(...args){ this.somethingElse.filterByColumn(..

我正在创建一个包装函数,将参数传递给某个内部函数调用。内部函数具有接收可选参数的选项

实际功能


 filterByColumn(
    fieldName: string,
    predicate?: string,
    matchCase?: boolean,
    actualOperator?: string
  ) {
    
  }
包装器


 wrapperFunc(...args){
    this.somethingElse.filterByColumn(...args); // <---- not working 
 }


wrapperFunc(…args){

this.somethingElse.filterByColumn(…args);//这不是类型脚本吗?以及“不工作”的意思是:有编译错误吗?运行时错误吗?或者没有错误,但也不是期望的结果吗?请说明如何调用
wrapperFunc(…args)
这不是有效的JavaScript。请提供一个脚本并描述您遇到的错误。您可以使用类似于
包装器(…args:Parameters)
@Mitya这是typescript的东西