Typescript function signature that converts an array to tuple of mapped type

后端 未结 0 888
滥情空心
滥情空心 2021-01-15 11:02

In typescript, an array can be converted to tuple by

type Arr = any[];
const f = < T extends Arr > (...args: [...T]): [...T] => {
  return args;
}

c         


        
相关标签:
回答
  • 消灭零回复
提交回复
热议问题