remove-first-element
v1.0.0
Published
JavaScript Package For Removing First Element Of An Array. And It Also Return The Element.
Downloads
6
Maintainers
Readme
remove-first-element
JavaScript Package For Removing First Element Of An Array. And It Also Return The Element.
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 [email protected] (https://bd.linkedin.com/in/prosen-ghosh-baba9aa8)
License
- MIT