Message from JavaScript discussions

September 2018

— Okay, i see


What you didnt hear, that imperative blocks of code, that reuse same variables, passing output to each other in last variable, maybe considered monad, pure functional why not.

— You can do impure code inside functions no problem

— As long as they have a pure interface


const map = (list, fn) => {
const result = [];
for (const item of list) {
return result;

Message permanent page

— This is clearly imperative

— But the function itself is pure

— When called

— Since:
* There is no state between calls
* It will always return the same output for the same input

— I bet, it will eat a lot of "functional style" because it's simplier

— Https://

— Guys, am i right when i say its obsolete to write an await in this situation:
await api.patch.then(res => res)

Message permanent page