10. implement Parameters<T>
Share
- accepted / - tried
For function type T, Parameters<T>
returns a tuple type from the types of its parameters.
Please implement MyParameters<T>
by yourself.
type Foo = (a: string, b: number, c: boolean) => stringtype A = MyParameters<Foo> // [a:string, b: number, c:boolean]type B = A[0] // stringtype C = MyParameters<{a: string}> // Error