Union Vs Intersection in ts
Jan 8 · 2 min read · Union - | Union acts like the unions in Set type:A = {1,2,3}B = {4,5}AUB = {1,2,3,4,5} So in terms of Typescript: interface Person { name: string; } interface Lifespan { birth: Date; death?: Date; } type unionCheck = Person | Lifespan // Can tak...
Join discussion