# some-truthy-right

> Checks if the callback returns truthy for any element of the array. Iteration is stopped once the callback returns truthy Return the truthy value or the last falsy value if none of the iteration returns truthy Run over the given array from right to

Latest version **1.2.0** (published 2021-05-31) · MIT license · 0 weekly downloads

## Install

```sh
npm install some-truthy-right
pnpm add some-truthy-right
yarn add some-truthy-right
bun add some-truthy-right
```

## 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.2.0 |
| Published | 2021-05-31 |
| First published | 2019-01-13 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 3.6 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 6 |
| Author | Natan Farkash |
| Maintainers | natqe3 |
| Keywords | some, truthy, right, some-truthy, some-right, truthy-some, truthy-right, right-some, right-truthy, some-truthy-right, some-right-truthy, truthy-some-right, truthy-right-some, right-some-truthy, right-truthy-some |

## Links

- npm: https://www.npmjs.com/package/some-truthy-right
- Repository: https://github.com/natqe/utilizes
- Homepage: https://github.com/natqe/utilizes#readme
- Issues: https://github.com/natqe/utilizes/issues
- npm.io page: https://npm.io/package/some-truthy-right

## Alternatives

- [@snazzah/davey](https://npm.io/package/@snazzah/davey.md) — 1.5M weekly downloads
- [@vendure/testing](https://npm.io/package/@vendure/testing.md) — 8.3K weekly downloads
- [vue-simple-context-menu](https://npm.io/package/vue-simple-context-menu.md) — 6.6K weekly downloads
- [cypress-webpack-preprocessor-v5](https://npm.io/package/cypress-webpack-preprocessor-v5.md) — 2.1K weekly downloads
- [@backstage/plugin-catalog-backend-module-puppetdb](https://npm.io/package/@backstage/plugin-catalog-backend-module-puppetdb.md) — 1.3K weekly downloads

## Recent versions

- 1.2.0 (latest) — 2021-05-31
- 1.1.10 — 2019-06-12
- 1.1.9 — 2019-04-23
- 1.1.8 — 2019-01-20
- 1.1.6 — 2019-01-20
- 1.1.4 — 2019-01-19
- 1.1.3 — 2019-01-15
- 1.1.2 — 2019-01-15
- 1.1.0 — 2019-01-15
- 1.0.12 — 2019-01-15
- 1.0.5 — 2019-01-14
- 1.0.4 — 2019-01-14
- 1.0.3 — 2019-01-13
- 1.0.2 — 2019-01-13
- 1.0.1 — 2019-01-13

## README

# someTruthyRight

Checks if the callback returns truthy for any element of the array. Iteration is stopped once the callback returns truthy

Return the truthy value or the last falsy value if none of the iteration returns truthy

Run over the given array from right to left

**Usage:** `someTruthyRight<T, R>(list: Array<T>, callback: (value: T, index: number, list: Array<T>) => R): R`

```typescript
import { someTruthyRight } from 'some-truthy-right'

someTruthyRight([0, 1, 2], num => num) // Return the first truthy value it found, from the right to left
// Output: 2
someTruthyRight([0, false, undefined, null], falsy => falsy) // Return the last falsy value if non of the given items is truthy, from the right to left
// Output: 0
```

<!-- *keywords [] *keywordsend -->


This module exported from [utilizes](https://www.npmjs.com/package/utilizes) project.

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