1 | Removes first value.
|
2 | [:package:](https://www.npmjs.com/package/@extra-array/shift)
|
3 | [:smiley_cat:](https://github.com/orgs/nodef/packages?repo_name=extra-array)
|
4 | [:running:](https://npm.runkit.com/@extra-array/shift)
|
5 | [:vhs:](https://asciinema.org/a/332128)
|
6 | [:moon:](https://www.npmjs.com/package/@extra-array/shift.min)
|
7 | [:scroll:](https://unpkg.com/@extra-array/shift/)
|
8 | [:newspaper:](https://nodef.github.io/extra-array/)
|
9 | [:blue_book:](https://github.com/nodef/extra-array/wiki/)
|
10 |
|
11 | > Alternatives: [shift], [shift$].<br>
|
12 | > Similar: [push], [pop], [shift], [unshift].
|
13 |
|
14 | > This is part of package [extra-array].
|
15 |
|
16 | [extra-array]: https://www.npmjs.com/package/extra-array
|
17 |
|
18 | <br>
|
19 |
|
20 | ```javascript
|
21 | array.shift(x);
|
22 | // x: an array
|
23 | ```
|
24 |
|
25 | ```javascript
|
26 | const array = require("extra-array");
|
27 |
|
28 | var x = [1, 2, 3];
|
29 | array.shift(x);
|
30 | // [2, 3]
|
31 |
|
32 | var x = [1, 2, 3, 4];
|
33 | array.shift(x);
|
34 | // [2, 3, 4]
|
35 | ```
|
36 |
|
37 | <br>
|
38 | <br>
|
39 |
|
40 |
|
41 | ## References
|
42 |
|
43 | - [Array.prototype.shift: MDN web docs](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/shift)
|
44 | - [immutable-iterable-prototype: @azu](https://github.com/azu/immutable-iterable-prototype)
|
45 |
|
46 | [shift]: https://github.com/nodef/extra-array/wiki/shift
|
47 | [shift$]: https://github.com/nodef/extra-array/wiki/shift$
|
48 | [push]: https://github.com/nodef/extra-array/wiki/push
|
49 | [pop]: https://github.com/nodef/extra-array/wiki/pop
|
50 | [unshift]: https://github.com/nodef/extra-array/wiki/unshift
|