README
[NodeJS] More Array
A NodeJS library/module to provide more ways to handle array.
License | MIT |
Release |
Latest: () Pre: () |
Release (NPM) |
Latest: Pre: |
Contributor | |
Issue | : |
Pull Request | : |
Code Quality |
📜 Description
🌟 Feature
- Provide missed method(s) to handle array.
- Native support for CommonJS and ECMAScript.
📄 Documentation
For the official documentation, please visit GitHub Repository Wiki.
Getting Started (Excerpt)
NodeJS (>= v10) & NPM (>= v6):
> npm install @hugoalh/more-array
API (Excerpt)
concatenate(...items)
flatten(item, maximumDepth?)
removeDuplicate(item)
reverse(item)
toObject(item)
Example (Excerpt)
const moreArray = require("@hugoalh/more-array");
let array1 = ["one", "two", "three"];
let array2 = ["one", "two", "three"];
console.log(array1);// ["one", "two", "three"]
console.log(Array.reverse(array1));// ["three", "two", "one"]
console.log(array1);// ["three", "two", "one"]
console.log(array2);// ["one", "two", "three"]
console.log(moreArray.reverse(array2));// ["three", "two", "one"]
console.log(array2);// ["one", "two", "three"]
let array3 = moreArray.concatenate(array1, array2);
console.log(array3);// ["three", "two", "one", "one", "two", "three"]
console.log(moreArray.removeDuplicate(array3));// ["three", "two", "one"]