# last-element

> Get the last element in an array.

Latest version **1.0.1** (published 2017-10-02) · MIT license · 0 weekly downloads

## Install

```sh
npm install last-element
pnpm add last-element
yarn add last-element
bun add last-element
```

## Health

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

Positive: has types package; no vulnerabilities; high quality score.

Warnings: low downloads; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.1 |
| Published | 2017-10-02 |
| First published | 2017-10-02 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | separate (@types/last-element) |
| Module format | CommonJS |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 1 |
| Author | Prosen Ghosh |
| Maintainers | prosen-ghosh |
| Keywords | last, array, element |

## Links

- npm: https://www.npmjs.com/package/last-element
- Repository: https://github.com/Prosen-Ghosh/last-element
- Homepage: https://github.com/Prosen-Ghosh/last-element#readme
- Issues: https://github.com/Prosen-Ghosh/last-element/issues
- npm.io page: https://npm.io/package/last-element

## Recent versions

- 1.0.1 (latest) — 2017-10-02
- 1.0.0 — 2017-10-02

## README

# last-element
Get the last element in an array.

![npm](https://img.shields.io/npm/v/last-element.svg) ![license](https://img.shields.io/npm/l/last-element.svg) ![github-issues](https://img.shields.io/github/issues/Prosen-Ghosh/last-element.svg) 


![nodei.co](https://nodei.co/npm/last-element.png?downloads=true&downloadRank=true&stars=true)

![travis-status](https://img.shields.io/travis/Prosen-Ghosh/last-element.svg)
![stars](https://img.shields.io/github/stars/Prosen-Ghosh/last-element.svg)
![forks](https://img.shields.io/github/forks/Prosen-Ghosh/last-element.svg)

## Features


## `npm` Install

`npm install --save last-element`

## Script Tag

#### For Development
```js
<script src="https://rawgit.com/Prosen-Ghosh/last-element/master/last.js"></script>
```
#### For Production
```js
<script src="https://cdn.rawgit.com/Prosen-Ghosh/last-element/5c22c2c2/last.js"></script>
```

## Usage

```js
const last = require('last-element');

last([]);
//=> []

last([1]);
//=> 1

last([1,5,6,""]);
//=> ''

last([1,5,6,"",{}]);
//=> {}

last([1,5,6,"",{},[]]);
//=> []

last([1,5,6,"",{},[],-5]);
//=> -5

last(); // without parameter this function will throw a type error
//=> TypeError: last() expects an array parameter

```

## Author

Prosen Ghosh <prosenghosh25@gmail.com>

## License

 - **MIT**

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