UNPKG

1.37 kBMarkdownView Raw
1Removes first value.
2[:package:](https://www.npmjs.com/package/@extra-array/shift-update)
3[:smiley_cat:](https://github.com/orgs/nodef/packages?repo_name=extra-array)
4[:running:](https://npm.runkit.com/@extra-array/shift-update)
5[:vhs:](undefined)
6[:moon:](https://www.npmjs.com/package/@extra-array/shift-update.min)
7[:scroll:](https://unpkg.com/@extra-array/shift-update/)
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 (updated)
23// → x
24```
25
26```javascript
27const array = require("extra-array");
28
29var x = [1, 2, 3];
30array.shift$(x);
31// [2, 3]
32
33x;
34// [2, 3]
35
36var x = [1, 2, 3, 4];
37array.shift$(x);
38// [2, 3, 4]
39```
40
41<br>
42<br>
43
44
45## References
46
47- [Array.prototype.shift: MDN web docs](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/shift)
48
49[shift]: https://github.com/nodef/extra-array/wiki/shift
50[shift$]: https://github.com/nodef/extra-array/wiki/shift$
51[push]: https://github.com/nodef/extra-array/wiki/push
52[pop]: https://github.com/nodef/extra-array/wiki/pop
53[unshift]: https://github.com/nodef/extra-array/wiki/unshift