# first-mapped

> Returns the first truthy mapping of elements in an array

Latest version **0.2.0** (published 2016-09-10) · ISC license · 0 weekly downloads

## Install

```sh
npm install first-mapped
pnpm add first-mapped
yarn add first-mapped
bun add first-mapped
```

## 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.2.0 |
| Published | 2016-09-10 |
| First published | 2016-09-10 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Allain Lalonde |
| Maintainers | allain |
| Keywords | map, utility |

## Links

- npm: https://www.npmjs.com/package/first-mapped
- npm.io page: https://npm.io/package/first-mapped

## Alternatives

- [lodash.assign](https://npm.io/package/lodash.assign.md) — 2.3M weekly downloads
- [lodash.chunk](https://npm.io/package/lodash.chunk.md) — 1.8M weekly downloads
- [react-native-ios-utilities](https://npm.io/package/react-native-ios-utilities.md) — 138.5K weekly downloads
- [@technically/lodash](https://npm.io/package/@technically/lodash.md) — 50.9K weekly downloads
- [@fluid-topics/ft-icon](https://npm.io/package/@fluid-topics/ft-icon.md) — 20.6K weekly downloads

## Recent versions

- 0.2.0 (latest) — 2016-09-10
- 0.1.0 — 2016-09-10

## README

# first-mapped

Returns the first truthy mapping of elements in an array.

It's a very small package that implements a pattern I kept seeing.

It's much like `Array.find` except it returns the value computed 
instead of the element that it's computed from

## Installation

```bash
npm install --save first-mapped
```

## Usage

```JavaScript
const firstMapped = require('first-mapped')

let mapped = firstMapped([1, 2, 3], (val, index, arr) => {
  if (val === 3) {
    return 'HERE'
  } else {
    return false
  }
})

console.log(mapped) // HERE 
```

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