In programming, there is the phrase "passing a variable". That is the moment when we call a function with a given parameter. In some languages ...
Very often, we have to transform objects from one shape to another. My favorite tool for such transformations is the `reduce` function
The iterable protocol is underrated. I don't see people using it, which makes me sad because it's a wonderful instrument.
Very often, we need to look inside objects. One of my favorite ways to print an object is to use `JSON.stringify` API.
There are some APIs that I use frequently. `Object.assign` is one of them. For me, the use case is almost always constructing a new object by merging various properties.
I saw the first article about responsive design in 2010 (by Ethan Marcotte). Since then, the Web has evolved, and so ...
I find it very interesting how we start forgetting stuff when technology evolves. One of these things is the event delegation.
There is one thing that developers forget very often - error handling.
I remember when copying to a clipboard was done via embedding a small Flash app. Nowadays, we have an API for this.
Early in this book, we mentioned the async/await syntax. I remember the time when this API came to the language. Our code became ...
Sometimes I like to solve problems that libraries already solve. One of those problems is handling multiple async operations one after the other.
Did you ever wonder how the call-to-action widgets work? You know, those little buttons for sharing content on social networks.
Earlier in this book, we learned about the destructuring assignment. An interesting use case of this feature is that it allows us to remove a field from an object.
It's funny how in the past we had to write a lot of things alone. There was no NPM or GitHub. We had to write our own loader.
There are tons of different opinions on what is a good code. For me, the best answer is, "Good code is the one that I and my teammates understand".
We saw the four different types of scope. I want to share a small tip regarding the block scope. And precisely when we need to create it on purpose.
When we know what scope is, it's time to explore the `call`, `apply`, and `bind` methods.
Back in the days when the Web was all made of jQuery, we were constantly using a pattern - function (or method) chaining.
Recursion is probably one of the oldest concepts in programming. It's the paradigm where a function calls itself.
Another popular functional programming paradigm is currying. It is kind of similar to the partial application in the sense that it allows us to split the function call.
State machines must be taught equally as every other design pattern in programming. Interestingly, I started seeing state machines everywhere once I found this concept.
Now when we know what a state machine is, we can talk about `reducers`. That term became popular around the Redux library, where it is the main actor.
Flux architecture is one of those popular things that the ecosystem replaces with something new. Back in the early days of React, this pattern was the answer to many questions.
In this book, the Flux architecture chapter is before Redux on purpose. Historically Redux came after Flux and, it has almost the same structure. The one-way direction data flow is still here.
CSP (communicating sequential processes) is a formal language for describing patterns of interaction in concurrent systems. It's used in ...
In this section of the book, we will learn about six of my favorite design patterns. The first one is called "singleton".
Like a singleton, the factory pattern falls into the category of creational patterns. Those are patterns that are focused on the initialization of the objects.
The revealing module pattern is the one that I use the most in my daily job. Back in the days when we didn't have classes, this pattern was my primary tool for mimicking OOP.
Often, we use design patterns in programming without even knowing that they exist. The publish/subscribe pattern is one of them.
The idea of the command pattern is to separate the objects that trigger logic from the objects that implement it. The trivial variant involves ...