# @mohayonao/remove-if-exists

> remove if exists

Latest version **1.0.0** (published 2015-08-25) · MIT license · 0 weekly downloads

## Install

```sh
npm install @mohayonao/remove-if-exists
pnpm add @mohayonao/remove-if-exists
yarn add @mohayonao/remove-if-exists
bun add @mohayonao/remove-if-exists
```

## 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.0 |
| Published | 2015-08-25 |
| First published | 2015-08-25 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | mohayonao |
| Maintainers | mohayonao |

## Links

- npm: https://www.npmjs.com/package/@mohayonao/remove-if-exists
- Repository: https://github.com/mohayonao/remove-if-exists/
- Issues: https://github.com/mohayonao/remove-if-exists/issues
- npm.io page: https://npm.io/package/@mohayonao/remove-if-exists

## Recent versions

- 1.0.0 (latest) — 2015-08-25

## README

# remove-if-exists
[![Build Status](http://img.shields.io/travis/mohayonao/remove-if-exists.svg?style=flat-square)](https://travis-ci.org/mohayonao/remove-if-exists)
[![NPM Version](http://img.shields.io/npm/v/@mohayonao/remove-if-exists.svg?style=flat-square)](https://www.npmjs.org/package/@mohayonao/remove-if-exists)
[![License](http://img.shields.io/badge/license-MIT-brightgreen.svg?style=flat-square)](http://mohayonao.mit-license.org/)

> remove if exists

## Installation

```
npm install @mohayonao/remove-if-exists
```

## API
- `removeIfExists(array: any[], target: any): boolean`
  - remove `target` if exists in `array`
  - return true if removed

## Example

```js
import removeIfExists from "@mohayonao/remove-if-exists";

let array = [ 1, 2, 3, 4, 5 ];

console.log(removeIfExists(array, 3)); // true
console.log(array); // [ 1, 2, 4, 5 ]

console.log(removeIfExists(array, 6)); // false
console.log(array); // [ 1, 2, 4, 5 ]
```

## License
MIT

---
_Source: https://npm.io/package/@mohayonao/remove-if-exists · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
