Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature]: zip #520

Open
1 of 2 tasks
ssi02014 opened this issue Oct 20, 2024 · 0 comments
Open
1 of 2 tasks

[Feature]: zip #520

ssi02014 opened this issue Oct 20, 2024 · 0 comments
Labels
feature 새로운 기능 추가 @modern-kit/utils @modern-kit/utils

Comments

@ssi02014
Copy link
Contributor

Package Scope

  • 기존 패키지에 기능 추가
  • 새로운 패키지
  • Package name: @modern-kit/utils/array

Overview

export function zip<T>(arr1: T[] | readonly T[]): [T][];

export function zip<T, U>(
  arr1: T[] | readonly T[],
  arr2: U[] | readonly U[]
): [T, U][];

export function zip<T, U, V>(
  arr1: T[] | readonly T[],
  arr2: U[] | readonly U[],
  arr3: V[] | readonly V[]
): [T, U, V][];

export function zip<T, U, V, W>(
  arr1: T[] | readonly T[],
  arr2: U[] | readonly U[],
  arr3: V[] | readonly V[],
  arr4: W[] | readonly W[]
): [T, U, V, W][];
const arr1 = [1, 2, 3];
const arr2 = ['a', 'b', 'c'];
const arr3 = [true, false, true];

zip(arr1); // [[1], [2], [3]];
zip(arr1, arr2); // [[1, 'a'], [2, 'b'], [3, 'b']];
zip(arr1, arr2, arr3); // [[1, 'a', true], [2, 'b', false], [3, 'b', true]];
@ssi02014 ssi02014 added feature 새로운 기능 추가 @modern-kit/utils @modern-kit/utils labels Oct 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature 새로운 기능 추가 @modern-kit/utils @modern-kit/utils
Projects
None yet
Development

No branches or pull requests

1 participant