common.js icon indicating copy to clipboard operation
common.js copied to clipboard

Feature: Array.js

Open r17x opened this issue 5 years ago • 5 comments

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. 👍

r17x avatar Aug 06 '19 13:08 r17x

chunk array

randyviandaputra avatar Aug 06 '19 13:08 randyviandaputra

@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 💯

r17x avatar Aug 06 '19 13:08 r17x

flatten array

const input = [1,2,3, [666,1337,8], [4,5,6]]

// output: [1,2,3,4,5,6,666,1337,31337]

faultables avatar Aug 06 '19 19:08 faultables

@108kb want to assign for that ? or just propose ?

r17x avatar Aug 06 '19 19:08 r17x

propose. usually I'm using reduce to deal with that

faultables avatar Aug 06 '19 19:08 faultables