UNPKG

@extra-array/shift-update

Version:
54 lines (39 loc) 1.37 kB
Removes first value. [:package:](https://www.npmjs.com/package/@extra-array/shift-update) [:smiley_cat:](https://github.com/orgs/nodef/packages?repo_name=extra-array) [:running:](https://npm.runkit.com/@extra-array/shift-update) [:vhs:](undefined) [:moon:](https://www.npmjs.com/package/@extra-array/shift-update.min) [:scroll:](https://unpkg.com/@extra-array/shift-update/) [:newspaper:](https://nodef.github.io/extra-array/) [:blue_book:](https://github.com/nodef/extra-array/wiki/) > Alternatives: [shift], [shift$].<br> > Similar: [push], [pop], [shift], [unshift]. > This is part of package [extra-array]. [extra-array]: https://www.npmjs.com/package/extra-array <br> ```javascript array.shift$(x); // x: an array (updated) // → x ``` ```javascript const array = require("extra-array"); var x = [1, 2, 3]; array.shift$(x); // [2, 3] x; // [2, 3] var x = [1, 2, 3, 4]; array.shift$(x); // [2, 3, 4] ``` <br> <br> ## References - [Array.prototype.shift: MDN web docs](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/shift) [shift]: https://github.com/nodef/extra-array/wiki/shift [shift$]: https://github.com/nodef/extra-array/wiki/shift$ [push]: https://github.com/nodef/extra-array/wiki/push [pop]: https://github.com/nodef/extra-array/wiki/pop [unshift]: https://github.com/nodef/extra-array/wiki/unshift