1.0.6 • Published 3 years ago
@immutable-array/pop v1.0.6
@immutable-array/pop
Immutable Array.prototype.pop()
Install
Install with npm:
npm install @immutable-array/popUsage
Same API with Array.prototype.pop()
/**
 * Removes the last element from an array and returns it.
 */
export declare function pop<T>(array: Array<T>): T[];Example
import { pop } from "@immutable-array/pop";
const originalArray = ["a", "b", "c", "d", "e"];
const resultArray = pop(originalArray);
assert.deepStrictEqual(resultArray, ["a", "b", "c", "d"]);Changelog
See Releases page.
Running tests
Install devDependencies and Run npm test:
npm i -d && npm testContributing
Pull requests and stars are always welcome.
For bugs and feature requests, please create an issue.
- Fork it!
- Create your feature branch: git checkout -b my-new-feature
- Commit your changes: git commit -am 'Add some feature'
- Push to the branch: git push origin my-new-feature
- Submit a pull request :D
Author
License
MIT © azu