# just-reduce-object

> reduce an object

Latest version **2.3.0** (published 2022-12-17) · MIT license · 0 weekly downloads

## Install

```sh
npm install just-reduce-object
pnpm add just-reduce-object
yarn add just-reduce-object
bun add just-reduce-object
```

## Health

**Score 30/100 (F)** — status: abandoned.

Positive: has types; esm support; no vulnerabilities; high quality score.

Warnings: low downloads.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 2.3.0 |
| Published | 2022-12-17 |
| First published | 2016-07-19 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 0 |
| Unpacked size | 6.2 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 6200 |
| Author | Giuseppe Gurgone |
| Maintainers | angus-c |
| Keywords | object, reduce, no-dependencies, just |

## Links

- npm: https://www.npmjs.com/package/just-reduce-object
- Repository: https://github.com/angus-c/just
- Homepage: https://github.com/angus-c/just#readme
- Issues: https://github.com/angus-c/just/issues
- npm.io page: https://npm.io/package/just-reduce-object

## Recent versions

- 2.3.0 (latest) — 2022-12-17
- 2.2.2 — 2022-11-19
- 2.2.1 — 2022-08-08
- 2.2.0 — 2022-08-07
- 2.1.0 — 2022-04-09
- 2.0.1 — 2021-11-13
- 2.0.0 — 2021-11-09
- 1.2.1 — 2021-11-01
- 1.2.0 — 2021-10-31
- 1.1.0 — 2018-08-09
- 1.0.3 — 2016-07-31
- 1.0.2 — 2016-07-31
- 1.0.1 — 2016-07-19
- 1.0.0 — 2016-07-19

## README

<!-- DO NOT EDIT THIS FILE! THIS FILE WAS AUTOGENERATED BY TEMPLATE-MATE -->
<!-- SEE https://github.com/angus-c/just/blob/master/CONTRIBUTING.md#readme-template -->

## just-reduce-object

Part of a [library](https://anguscroll.com/just) of zero-dependency npm modules that do just do one thing.
Guilt-free utilities for every occasion.

[`🍦 Try it`](https://anguscroll.com/just/just-reduce-object)

```shell
npm install just-reduce-object
```
```shell
yarn add just-reduce-object
```

Reduce an object

```js
import reduce from 'just-reduce-object';

// applies a function against an accumulator and each key-value pairs of the object
// to reduce it to a single value
reduce({a: 3, b: 5, c: 9}, (acc, key, value, index, keys) => {
  acc[value] = key;
  return acc;
}, {}); // {3: 'a', 5: 'b', 9: 'c'}

reduce({a: 3, b: 5, c: 9}, (acc, key, value, index, keys) => {
  acc += value;
  return acc;
}); // 17
```

---
_Source: https://npm.io/package/just-reduce-object · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
