Picolab / Picolab/pico-engine

Design: Reduce with empty array shouldn't default to 0

Open
#296 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

documentation
Dominant language
TypeScript
Stars
51
Forks
10
Avg merge
4m
Merged PRs (30d)
1

Description

Since reduce works with non-numbers too, there shouldn't be a default in this case, but rather null or an error.

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

The issue names no file, test, or entry point. First locate the reduce implementation and inspect how an empty array is currently handled, then review existing behavior for non-number reductions. Done requires a decided and tested empty-array behavior, since the issue leaves null versus an error unresolved.

Written by the indexing model from the issue text.

Assessment

Tech stack
node.js, typescript
Domain
backend
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.