UNPKG

@extra-array/pop-update

Version:
53 lines (38 loc) 1.36 kB
Removes last value. [:package:](https://www.npmjs.com/package/@extra-array/pop-update) [:smiley_cat:](https://github.com/orgs/nodef/packages?repo_name=extra-array) [:running:](https://npm.runkit.com/@extra-array/pop-update) [:vhs:](https://asciinema.org/a/332107) [:moon:](https://www.npmjs.com/package/@extra-array/pop-update.min) [:scroll:](https://unpkg.com/@extra-array/pop-update/) [: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 (updated) ``` ```javascript const array = require("extra-array"); var x = [1, 2, 3]; array.pop$(x); // [ 1, 2 ] 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) [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