common.js
common.js copied to clipboard
Feature: Array.js
Array
- [x] Get Unique Item in Array.
- [x] Get first Item in Array.
- [ ] Get Chunk Array. [propose|todo] @randyviandaputra
- [ ] Flatten Array. [propose|todo] @108kb
- [ ] Add your idea in Array.
Note: the label of todo, feel free to contribute. 👍
chunk array
@randyviandaputra thank you, if you want to add this function fork this repo, write code on here https://github.com/ri7nz/common.js/blob/feature/Array/src/Array.js with comment, comment use for generating the documentation in README.md
like this https://github.com/ri7nz/common.js/tree/feature/Array#getfirst
/**
* @name xx
* @description xx
* /
// implement here
cheers 💯
flatten array
const input = [1,2,3, [666,1337,8], [4,5,6]]
// output: [1,2,3,4,5,6,666,1337,31337]
@108kb want to assign for that ? or just propose ?
propose. usually I'm using reduce
to deal with that