# map-reverse

> Apply a function to an array from then end to the beginning.

Latest version **1.0.1** (published 2016-01-21) · MIT license · 0 weekly downloads

## Install

```sh
npm install map-reverse
pnpm add map-reverse
yarn add map-reverse
bun add map-reverse
```

## Health

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

Positive: no vulnerabilities.

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

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.1 |
| Published | 2016-01-21 |
| First published | 2016-01-21 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 1 |
| Author | Andrey Belym |
| Maintainers | belym.a.2105 |
| Keywords | map, iterator |

## Links

- npm: https://www.npmjs.com/package/map-reverse
- Repository: https://github.com/AndreyBelym/map-reverse
- Homepage: https://github.com/AndreyBelym/map-reverse#readme
- Issues: https://github.com/AndreyBelym/map-reverse/issues
- npm.io page: https://npm.io/package/map-reverse

## Recent versions

- 1.0.1 (latest) — 2016-01-21
- 1.0.0 — 2016-01-21

## README

# map-reverse

[![Build Status](https://travis-ci.org/AndreyBelym/map-reverse.svg?branch=master)](https://travis-ci.org/AndreyBelym/map-reverse)

*Apply a function to an array from then end to the beginning.*

It's may be useful when iterating an array and deleting its elements at the same time.

## Install
```
npm install map-reverse
```

## Usage
Reverse iteration allows you to delete current element from an array when iterating.
```
var mapReverse = require('map-reverse');

var a = [1, 2, 3, 4, 5, 6, 7];

var b = mapReverse(a, function (item, index) {
    if (item % 2)
        a.splice(index, 1);

    return item;
});

console.log(a);
//[ 2, 4, 6 ]

console.log(b);
//[ 7, 6, 5, 4, 3, 2, 1 ]
```

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