Echo JS 0.11.0

<~>

xat comments

xat 327 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 328 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 350 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 350 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 388 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 393 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]
xat 397 days ago. link 0 point
The libraries/projects I mentioned were only those which quickly came to my mind. Probably we would need to inspect a larger dataset in order to get meaningful results on the topic.

IMHO the reason why alot of single person projects gain traction at all is because they tend to have nice APIs. APIs which developers enjoy using. This is because those single persons have a clear picture in their head about how their library should work.
That's also why TJ has so many popular projects (in my opinion). It's because he does a great job designing the APIs. Funny thing is that he is also an actual designer :)
[more]