Skip to content

intersection() function

iterable1에 포함된 iterable2의 모든 요소의 Iterable/AsyncIterable을 반환합니다.

Signature:

typescript
declare function intersection<T>(
  iterable1: Iterable<T>,
  iterable2: Iterable<T>,
): IterableIterator<T>;

Example

ts
const iter = intersection([2, 1], [2, 3, 4]);
iter.next(); // {value: 2, done:false}
iter.next(); // {value: undefined, done: true}

Open Source Code

Released under the Apache-2.0 License.