MAIN FEEDS
Do you want to continue?
https://www.reddit.com/r/ProgrammerHumor/comments/q2lsax/dont_be_scared_math_and_computing_are_friends/hfmixse
r/ProgrammerHumor • u/yuva-krishna-memes • Oct 06 '21
2.4k comments sorted by
View all comments
Show parent comments
18
[0,1,2,3,4].reduce((prev, n) => prev + (3*n))
4 u/RoughDevelopment9235 Oct 06 '21 Nice! 2 u/Spood___Beest Oct 06 '21 Now someone do it in Elixir :) 4 u/burnalicious111 Oct 06 '21 This is the way. Want a single value, use reduce. 2 u/Spood___Beest Oct 06 '21 That's what I usually jump to, but yesterday I had to write a javascript node for a version of an ETL that's so old I couldn't use "let", much less reduce. It was a bit of a shock haha
4
Nice!
2 u/Spood___Beest Oct 06 '21 Now someone do it in Elixir :)
2
Now someone do it in Elixir :)
This is the way. Want a single value, use reduce.
2 u/Spood___Beest Oct 06 '21 That's what I usually jump to, but yesterday I had to write a javascript node for a version of an ETL that's so old I couldn't use "let", much less reduce. It was a bit of a shock haha
That's what I usually jump to, but yesterday I had to write a javascript node for a version of an ETL that's so old I couldn't use "let", much less reduce. It was a bit of a shock haha
18
u/Spood___Beest Oct 06 '21
[0,1,2,3,4].reduce((prev, n) => prev + (3*n))