Closed theIYD closed 6 years ago
Thanks @theIYD
This is a bit big and has the same situation as #18
so I'll keep it open with the label later
when we see how codetogo evolves
Cool !
Does Code To Go need one liner solutions specifically as of now ?
Not necessarily one liner solutions, for example How to fetch json in JavaScript and other use cases are more than one line, however they're tackling a single use case, rather than a ready made function.
The reason why I'm avoiding functions is because 30-seconds-of-code has most of these covered
30-seconds-of-code has one liner solutions (most of them). Of course there is a noticeable difference between the two.
Will be posting more use cases. 😊👍
yes indeed, the problem is if you take a look at this example:
const flattenDepth = (arr, depth = 1) =>
depth != 1 ? arr.reduce((a, v) => a.concat(Array.isArray(v) ? flattenDepth(v, depth - 1) : v), [])
: arr.reduce((a, v) => a.concat(v), []);
you can immediately understand what the function does but reading what's happening inside the function takes a lot more time
And awesome thanks 😄
function thousandSeperator: Seperate thousands using commas
Reference: https://goo.gl/jKeiy8
Thanks @jadjoubran 😊