UNPKG

1.42 kBMarkdownView Raw
1Removes 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
21array.shift(x);
22// x: an array
23```
24
25```javascript
26const array = require("extra-array");
27
28var x = [1, 2, 3];
29array.shift(x);
30// [2, 3]
31
32var x = [1, 2, 3, 4];
33array.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