UNPKG

@extra-array/pop

Version:
51 lines (37 loc) 1.39 kB
Removes last value. [:package:](https://www.npmjs.com/package/@extra-array/pop) [:smiley_cat:](https://github.com/orgs/nodef/packages?repo_name=extra-array) [:running:](https://npm.runkit.com/@extra-array/pop) [:vhs:](https://asciinema.org/a/332108) [:moon:](https://www.npmjs.com/package/@extra-array/pop.min) [:scroll:](https://unpkg.com/@extra-array/pop/) [:newspaper:](https://nodef.github.io/extra-array/) [:blue_book:](https://github.com/nodef/extra-array/wiki/) > Alternatives: [pop], [pop$].<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.pop(x); // x: an array ``` ```javascript const array = require("extra-array"); var x = [1, 2, 3]; array.pop(x); // [ 1, 2 ] var x = [1, 2, 3, 4]; array.pop(x); // [ 1, 2, 3 ] ``` <br> <br> ## References - [Array.prototype.pop: MDN web docs](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/pop) - [immutable-iterable-prototype: @azu](https://github.com/azu/immutable-iterable-prototype) [pop]: https://github.com/nodef/extra-array/wiki/pop [pop$]: https://github.com/nodef/extra-array/wiki/pop$ [push]: https://github.com/nodef/extra-array/wiki/push [shift]: https://github.com/nodef/extra-array/wiki/shift [unshift]: https://github.com/nodef/extra-array/wiki/unshift