remove-first-element

1.0.0 • Public • Published

remove-first-element

JavaScript Package For Removing First Element Of An Array. And It Also Return The Element.

npm license github-issues

stars forks

Features

Install

npm install --save remove-first-element

Script Tag

For Development

<script src="https://rawgit.com/Prosen-Ghosh/remove-first-element/master/remove-first.js"></script>

For Production

<script src="https://cdn.rawgit.com/Prosen-Ghosh/remove-first-element/90851024/remove-first.js"></script>

Usage

 
const removeFirst = require('remove-first-element');
 
removeFirst([]);
//=> null
 
removeFirst([10,20,30]);
//=> 10
 
removeFirst([{}]);
//=> {}
 
removeFirst([[],1,2,3]);
//=> []
 
removeFirst(["foo","bar"]);
//=> 'foo'
 
removeFirst([function(){},"bar"]);
//=> [Function]
 
removeFirst();
//=> TypeError: removeFirst() expects an array parameter
 

Author

Prosen Ghosh prosenghosh25@gmail.com (https://bd.linkedin.com/in/prosen-ghosh-baba9aa8)

License

  • MIT

Package Sidebar

Install

npm i remove-first-element

Weekly Downloads

1

Version

1.0.0

License

MIT

Last publish

Collaborators

  • prosen-ghosh