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.
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);
}
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;
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.
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.