1.0.0 • Published 7 years ago

remove-first-element v1.0.0

Weekly downloads
5
License
MIT
Repository
github
Last release
7 years ago

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