Message from JavaScript discussions

December 2020

— Boring.. now i understand why reduce is used


const indexesOf = (arr, find) =>, i) => [e, i]).filter(([e, i]) => e === find).map(([e, i]) => i)

return arr.filter(e => indexesOf(arr, e).length > 1)

— Is this O(n)?

— Idk

— It's not

— The reason I don't use map,reduce and filter writing solving codes lol. It messes up with the readability of code. I would rather write few loops to get job done. However, this is my personal preference as I have seen many one liners code do wonders.

Message permanent page

— I tried this and it failed

— The trick is to try until you succeed

— It doesn't, in this case it's just a missing formatter which puts every call in an own line

— Besides the shortname variables tho xd

— Yeah I was busy doing other stuff

— Ofc, no critics :p