readme files
This commit is contained in:
3
06_complex/Readme.md
Normal file
3
06_complex/Readme.md
Normal file
@@ -0,0 +1,3 @@
|
||||
# Разберите приведённые примеры
|
||||
|
||||
> обратите внимание как применяется infer
|
||||
@@ -14,4 +14,4 @@ const double = (x: number, s: 'foo') => x * 2;
|
||||
// get type of first argument of function
|
||||
type GetFirstFuncArg<Arg> = Arg extends (a, x: infer T) => any ? T : never;
|
||||
|
||||
type DoubleArgType = GetFirstFuncArg<typeof double>
|
||||
type DoubleArgType = GetFirstFuncArg<typeof double>
|
||||
|
||||
Reference in New Issue
Block a user