• 카테고리

    질문 & 답변
  • 세부 분야

    프로그래밍 언어

  • 해결 여부

    미해결

[참고용]union 과 intersection

21.10.16 22:45 작성 조회수 132

3

이름은 분명히 union이니까 합집합 같은데 하는건 교집합같은 것(or연산자를 이용해서)을 하고 있고.. 뭐지 너무 헷갈리네해서 찾아봤는데요 참고 하실분들 참고하세요

타입스크립트 공홈에서 퍼왔습니다.

It might be confusing that a union of types appears to have the intersection of those types’ properties. This is not an accident - the name union comes from type theory. The union number | string is composed by taking the union of the values from each type. Notice that given two sets with corresponding facts about each set, only the intersection of those facts applies to the union of the sets themselves. For example, if we had a room of tall people wearing hats, and another room of Spanish speakers wearing hats, after combining those rooms, the only thing we know about every person is that they must be wearing a hat.

답변 1

답변을 작성해보세요.

0

안녕하세요 const님, 네 처음에는 좀 헷갈릴 거예요. 다른 분들을 위해 공유해 주셔서 감사합니다 :)