HowProgrammingWorks / HowProgrammingWorks/Composition

Function 'compose' applies functions to array of arguments instead of apply to every argument in array

Open
#4 0 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
JavaScript
Stars
20
Forks
65
PR merge metrics
No merged PRs in 30d

Description

File 4-multiple.js, line 3-4
could you use this tiny enhancement
const compose = (...fns) => (...args) => fns.reduce((args, fn) => args.map(v => fn(v)), args)

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Open 4-multiple.js and inspect lines 3-4 first. Compare the current compose behavior with the requested expression, then verify that each function is applied to every argument in the array. Done means the compose implementation reflects the requested enhancement.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
tooling
Issue type
Feature
Difficulty
1/5
Estimated time
Under an hour
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.