type MyExclude<T, U> = T extends U ? never : T
Solution by AleksandrShcherbackov #36143
type MyExclude<T, U> = T extends U ? never : T
Solution by KimKyuHoi #36127
type MyExclude<T, U> = T extends U ? never : T
Solution by buglavecz #36094
type MyExclude<T, U> = T extends U ? never : T;
Solution by karazyabko #36027
type MyExclude<T, U> = T extends U ? never : T;
Solution by codingaring #35935
// your answers
type MyExclude<T, U> = T extends U ? never : T
Solution by pytest5 #35924
// 你的答案
type MyExclude<T, U> = T extends U ? never : T;
Solution by reonce #35917
type MyExclude<T, U> = T extends U ? never : T;
Solution by HelloWook #35910
// 你的答案
type MyExclude<T, U> = T extends U ? never : T
Solution by song4613107 #35789
// 你的答案
type MyExclude<T, U> = T extends U ? never : T
Solution by song4613107 #35788
type MyExclude<T, U> = T extends U ? never : T;
Solution by Sensuele #35762
type MyExclude<T, U> = T extends U ? never : T;
Solution by thukyaw11 #35529
type MyExclude<T, U> = T extends U ? never : T;
Solution by gangnamssal #35478
type MyExclude<T, U> = T extends U ? never : T
Solution by RanungPark #35433
// your answers
type initial = "a" | "b" | "c";
type MyExclude<T, V> = T extends V ? never : T;
const data: MyExclude<initial, "c"> = "a";
const data2: MyExclude<initial, "c"> = "b";
Solution by Sathiyapramod #35413
type MyExclude<T, U> = T extends U ? never : T
Solution by gyeounjeong #35355
type MyExclude<T, U> = T extends U ? never : T;
Solution by Kim-Ji-Seop #35337
type Exclude<T extends unknown, U extends T | PropertyKey | unknown = T> = T extends U ? never : T;
type MixedTypes = 'apple' | 'banana' | 1 | 2 | (() => void) | { key: string } | false;
type Test1 = Exclude<MixedTypes, 'apple' | 'banana'>; // 'apple' | 'orange'
type Test2 = Exclude<MixedTypes, 1 | 2>; // 'apple' | 'banana' | (() => void) | { key: string } | false
type Test3 = Exclude<MixedTypes, false>; // 'apple' | 'banana' | 1 | 2 | (() => void) | { key: string }
type Test4 = Exclude<MixedTypes, (() => void) | { key: string }>; // 'apple' | 'banana' | 1 | 2 | false
type Test5 = Exclude<MixedTypes, string> // false | {key: string;} | 1 | 2 | (() => void)
type Test6 = Exclude<MixedTypes, string | number> // false | {key: string;} | (() => void)
type Test7 = Exclude<MixedTypes, string | number | boolean> // {key: string;} | (() => void)
type Test8 = Exclude<MixedTypes, Function> // {key: string;}
Solution by w3Scribe #35198
type MyExclude<T, U> = T extends U ? never : T;
Solution by raeyoung-kim #34938
type MyExclude<T, U> = T extends U ? never : T
Solution by 56aiden90 #34879
type MyExclude<T, U extends Partial<T>> = T extends U ? never : T
Solution by nguyste #34854
type MyExclude<T,U> = T extends U ? never : T
Solution by xiaosi-ss #34841
type MyExclude<T, U> = T extends U ? never : T
Solution by eunsukimme #34811
type MyExclude<T, U> = T extends U ? never : T
Solution by kang-kibong #34745
type MyExclude<T, U> = T extends U ? never : T
Solution by Git-I985 #34701
// your answers
type MyExclude<T, U> = T extends U ? never : T
Solution by zeyuanHong0 #34690
type MyExclude<T, U> = T extends U ? never : T;
Solution by nathan2slime #34658
type MyExclude<T, U> = T extends U ? never : T
Solution by Hailey0930 #34638
type MyExclude<T, U> = T extends U ? never : T
Solution by devshinthant #34543
// your answers
type MyExclude<T, U> = T extends U ? never : T;
Solution by LeeKangHyun #34455