micheleriva / micheleriva/std

Add ZipWith

Open
#2 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
TypeScript
Stars
23
Forks
2
PR merge metrics
No merged PRs in 30d

Description

`zipWith` works similar to `zip`, but applies a function to all the elements in the lists.
Its signature is `(a -> b -> c) -> [a] -> [b] -> [c]` and should be used the following way:

When inherited:
```js
[1, 2, 3].zipWith((x) => x * 2, [4, 5, 6]) // => [4, 10, 18]
```

When used as a standalone function:

```js
zipWith((x) => x * 2, [1, 2, 3], [4, 5, 6]) // => [4, 10, 18]
```

Contributor guide

Open the contributing guide

Research direction

Locate the existing zip implementation and its tests in the TypeScript library, then review how inherited and standalone functions are exposed. Add zipWith with the signature and behavior shown in the issue, and verify that both usage forms combine corresponding elements as demonstrated.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
tooling
Issue type
Feature
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
52/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.