03312-easy-parameters

Back

type MyParameters<T extends (...args: any[]) => any> = Parameters<T>
type MyParameters<T extends (...args: any[]) => any> = T extends (...args: infer R )=> void ? [...R]: never

Solution by TaueFenCheng #35535

type MyParameters<T extends (...args: Array<any>) => any> = T extends (...args: infer P) => unknown ? P : never;

Solution by gangnamssal #35495

// your answers
type MyParameters<T extends Function> = T extends (...args: infer Params) => any ? Params : never;

Solution by Sathiyapramod #35458

type MyParameters<T> = T extends (...args: infer U) => void ? U : [] 

Solution by RanungPark #35445

type MyParameters<T> = T extends (...args: infer P) => unknown ? P : unknown

Solution by gyeounjeong #35363

type InferArray<T extends any[]> = 
  T extends [infer HEAD, ...infer TAIL] ? [HEAD, ...InferArray<TAIL>] : [];
type MyParameters<T extends (...args: any[]) => any> = 
  T extends ((...args: infer K extends any[]) => any) ? InferArray<K> : [];

Solution by CrimsoonXIII #35048

type MyParameters<T> = T extends (...args: infer P) => unknown ? P : never

Solution by ClarityOfMind #35004

// 你的答案
type MyParameters<T extends (...args: any[]) => any> = T extends (...args: infer A) => any
  ? [...A]
  : never

Solution by showthesunli #34971

type MyParameters<T extends (...args: any[]) => any> = T extends (...args: infer P) => any ? P : never;

Solution by raeyoung-kim #34947

type MyParameters<T extends (...args: any[]) => any> = T extends (...args: infer Params) => any ? Params : unknown;

Solution by 56aiden90 #34888

type MyParameters<T extends (...args: any[]) => any> = T extends (...args: infer Params) => any ? Params : never

Solution by eunsukimme #34818

// 你的答案
type MyParameters<T extends (...args: any[]) => any> = T extends (...args: infer U) => any ? U : never

Solution by zeyuanHong0 #34730

// your answers
type MyParameters<T extends (...args: any[]) => any> = T extends (...args: infer P) => any ? P : never;

Solution by AndreGeng #34716

type MyParameters<T extends (...args: any[]) => any> = T extends (
  ...args: infer P
) => infer R
  ? [...P]
  : never;

Solution by lephuthuc2001 #34711

type MyParameters<T extends (...args: any[]) => any> = T extends (...any: infer S) => any ? S : any

Solution by Hailey0930 #34685

type MyParameters<T> = T extends (...any: infer S) => any ? S : any 

Solution by nathan2slime #34665

type MyParameters<T extends (...args: any[]) => any> = T extends (...args: infer I) => unknown ? I : []
// your answers

Solution by Rustamaha #34557

type MyParameters<T extends (...args: any[]) => any> = T extends (...args: infer Param) => any ?  Param : never

Solution by devshinthant #34551

type MyParameters<T extends (...args: any[]) => any> = T extends (...arg: infer P)=> unknown ? P : never

Solution by binhdv155127 #34478

// 여기 풀이를 입력하세요
type MyParameters<T extends (...args: any[]) => any> = T extends (...args: infer P) => any ? P : never;

Solution by LeeKangHyun #34466

We should use infer P to guess args' types. So, use extends and infer keywords to find args' types.


type MyParameters<T extends (...args: any[]) => any> = T extends (...args: infer P) => any ? P : never;

Solution by dev-jaemin #34460

type MyParameters<T extends (...args: any[]) => any> = T extends (...args : infer P) => any ? P : never;

Solution by bkdragon0228 #34438

type MyParameters<T extends (...args: any[]) => any> = T extends (...args: infer Args) => any ? Args : any;

Solution by ktim816 #34430

// your answers
type MyParameters<T extends (...args: any[]) => any> =  T extends (...args: infer P) => any? P : never

Solution by gobielJonathan #34396

type MyParameters<T extends (...args: any[]) => any> = T extends (...args: infer P) => any ? P : [];

Solution by wxh-cyber #34372

type MyParameters<T extends (...args: any[]) => any> = T extends (...args: infer P) => any ? P : [];

Solution by wxh-cyber #34371

type MyParameters<T extends (...args: any[]) => any> = T extends () => any
  ? []
  : T extends (...args: infer P) => any ? P : []

Solution by rookie-luochao #34365

type MyParameters<T extends (...args: any[]) => any> = T extends (...args: infer P) => any ? P: never

Solution by souzaramon #34319

// 你的答案

type MyParameters<T extends (...args: any[]) => any> = T extends (...args:[...infer A]) => unknown?[...A]:never

Solution by W-fitTiger #34251

type MyParameters<T extends (...args: any[]) => any> = T extends (...args: infer Params) => any ? Params : never

Solution by quitone #34198