Exclude
#
introductionImplement the built-in Exclude<T, U>
View on GitHubExclude from T those types that are assignable to U
#
start pointtsTry
/* _____________ Your Code Here _____________ */typeMyExclude <T ,U > = any;Â/* _____________ Test Cases _____________ */typecases = [Type 'false' does not satisfy the constraint 'true'.2344Type 'false' does not satisfy the constraint 'true'.Expect <Equal <MyExclude <'a' | 'b' | 'c', 'a'>,Exclude <'a' | 'b' | 'c', 'a'>>>,Expect <Type 'false' does not satisfy the constraint 'true'.2344Type 'false' does not satisfy the constraint 'true'.Equal <MyExclude <'a' | 'b' | 'c', 'a' | 'b'>,Exclude <'a' | 'b' | 'c', 'a' | 'b'>>>,Expect <Type 'false' does not satisfy the constraint 'true'.2344Type 'false' does not satisfy the constraint 'true'.Equal <MyExclude <string | number | (() => void),Function >,Exclude <string | number | (() => void),Function >>>];
take the challengetsTry
/* _____________ Your Code Here _____________ */typeMyExclude <T ,U > = any;Â/* _____________ Test Cases _____________ */typecases = [Type 'false' does not satisfy the constraint 'true'.2344Type 'false' does not satisfy the constraint 'true'.Expect <Equal <MyExclude <'a' | 'b' | 'c', 'a'>,Exclude <'a' | 'b' | 'c', 'a'>>>,Expect <Type 'false' does not satisfy the constraint 'true'.2344Type 'false' does not satisfy the constraint 'true'.Equal <MyExclude <'a' | 'b' | 'c', 'a' | 'b'>,Exclude <'a' | 'b' | 'c', 'a' | 'b'>>>,Expect <Type 'false' does not satisfy the constraint 'true'.2344Type 'false' does not satisfy the constraint 'true'.Equal <MyExclude <string | number | (() => void),Function >,Exclude <string | number | (() => void),Function >>>];