# jq-reduce

> jQuery reduce plugin

Latest version **0.1.0** (published 2015-11-14) · MIT license · 0 weekly downloads

## Install

```sh
npm install jq-reduce
pnpm add jq-reduce
yarn add jq-reduce
bun add jq-reduce
```

## Health

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

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.1.0 |
| Published | 2015-11-14 |
| First published | 2015-10-03 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Cesar Kastli |
| Maintainers | cizar |

## Links

- npm: https://www.npmjs.com/package/jq-reduce
- Repository: https://github.com/cizar/jq-reduce
- Homepage: https://github.com/cizar/jq-reduce#readme
- Issues: https://github.com/cizar/jq-reduce/issues
- npm.io page: https://npm.io/package/jq-reduce

## Recent versions

- 0.1.0 (latest) — 2015-11-14
- 0.0.3 — 2015-10-20
- 0.0.2 — 2015-10-05
- 0.0.1 — 2015-10-03

## README

# jQuery reduce()

The classic example

```javascript
var total = $.reduce([1, 2, 3], function(p, c) {
  return p + c;
}, 0);
```

Reduce a jQuery collection into an Object

```javascript
var refs = $('[ref]').reduce(function(p, c) {
  p[c.attributes.ref.value] = c;
  return p;
}, {});
```

Reduce a jQuery collection into an Array

```javascript
var values = $(':text').reduce(function(p, c) {
  p.push(c.value);
  return p;
}, []);
```

The current item of the collection is the default context

```javascript
var names = $(':input').reduce(function(p){
  return p.concat(this.name);
}, []);
```

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