last-element
Get the last element in an array.
Features
npm
Install
npm install --save last-element
Script Tag
For Development
<script src="https://rawgit.com/Prosen-Ghosh/last-element/master/last.js"></script>
For Production
<script src="https://cdn.rawgit.com/Prosen-Ghosh/last-element/5c22c2c2/last.js"></script>
Usage
const last = ; ;//=> [] ;//=> 1 ;//=> '' ;//=> {} ;//=> [] ;//=> -5 ; // without parameter this function will throw a type error//=> TypeError: last() expects an array parameter
Author
Prosen Ghosh prosenghosh25@gmail.com
License
- MIT