
JavaScript Browser environment, specs
1. Overview The JavaScript language was initially created for web browsers. Since then it has evolved and become a language with many uses and platforms. […]
1. Overview The JavaScript language was initially created for web browsers. Since then it has evolved and become a language with many uses and platforms. […]
A recent additionThis is a recent addition to the language. You can find the current state of support at https://caniuse.com/#feat=bigint. BigInt is a special numeric type that […]
1. Overview In-depth language feature This article covers an advanced topic, to understand certain edge-cases better. It’s not important. Many experienced developers live fine without […]
1. Overview Currying is an advanced technique of working with functions. It’s used not only in JavaScript, but in other languages as well. Currying is a […]
1. Overview The built-in eval function allows to execute a string of code. The syntax is: For example: A string of code may be long, contain line […]
A Proxy object wraps another object and intercepts operations, like reading/writing properties and others, optionally handling them on its own, or transparently allowing the object to handle […]
1. Overview Export and import statements that we covered in previous chapters are called “static”. The syntax is very simple and strict. First, we can’t […]
Export and import directives have several syntax variants. In the previous article we saw a simple use, now let’s explore more examples. 1. Export before […]
As our application grows bigger, we want to split it into multiple files, so called “modules”. A module may contain a class or a library […]
Asynchronous iteration allow us to iterate over data that comes asynchronously, on-demand. Like, for instance, when we download something chunk-by-chunk over a network. And asynchronous […]
Regular functions return only one, single value (or nothing). Generators can return (“yield”) multiple values, one after another, on-demand. They work great with iterables, allowing to […]
There’s a special syntax to work with promises in a more comfortable fashion, called “async/await”. It’s surprisingly easy to understand and use. 1. Async functions […]
Promise handlers .then/.catch/.finally are always asynchronous. Even when a Promise is immediately resolved, the code on the lines below .then/.catch/.finally will still execute before these handlers. Here’s a demo: If […]
“Promisification” is a long word for a simple transformation. It’s the conversion of a function that accepts a callback into a function that returns a […]
There are 6 static methods in the Promise class. We’ll quickly cover their use cases here. 1. Promise.all Let’s say we want many promises to execute in […]
1. Overview Promise chains are great at error handling. When a promise rejects, the control jumps to the closest rejection handler. That’s very convenient in […]
1. Overview Let’s return to the problem mentioned in the chapter Introduction: callbacks: we have a sequence of asynchronous tasks to be performed one after another […]
1. Overview Imagine that you’re a top singer, and fans ask day and night for your upcoming song. To get some relief, you promise to […]
1. Overview We use browser methods in examples here To demonstrate the use of callbacks, promises and other abstract concepts, we’ll be using some browser […]
When we develop something, we often need our own error classes to reflect specific things that may go wrong in our tasks. For errors in […]