Echo JS 0.11.0

<~>

xat comments

xat 2428 days ago. link 1 point
Agreed. I mostly keep the state in some container components and only use redux if it's really needed. That approach works just fine.
xat 2437 days ago. link 1 point
Interesting that this article got upvoted like hell on Reddit, but only gets downvotes here :)

Any reason for that?

IMHO it is a solid list. If you know all the topics mentioned, you are probably able to pickup any framework quite fast and have a good understanding about how JS works.
xat 2438 days ago. link 2 points
Not sure if this was made 100% clear in the article (although it's mentioned), but instead of an IIFE you can also use 'let' in the last example:

for (let i = 0; i < 5; i++) {
  setTimeout(function () {
    console.log('index: ' + i);
  }, 1000);
}
xat 2460 days ago. link 1 point
Yeah, I intentionally did the example with a number, because there you have the problem of 0 being falsy.
The `??`-solution would be nice IMHO.
xat 2460 days ago. link 1 point
Cool proposal in general, although there are still cases where _.get is somehow nicer:

const num = _.get(foo, 'bar.baz', 1337);

VS:

const num = typeof foo?.bar?.baz !== 'undefined' ? foo?.bar?.baz : 1337;
xat 2498 days ago. link 1 point
Interesting pattern, but this will probably result in some huge components where everything is plugged together. Would definitly like to see a bigger codebase using this approach.
xat 2504 days ago. link 1 point
Sorry, I know it might not be that cool to post a link to a Reddit discussion.

That said, IMHO it's quite useful to understand that even if you're passing​ object like things as arguments into functions, it's still call by value. You're copying a reference in that case.
[comment deleted]
[more]