JavaScript BigInt

2021 VietMX 0

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 […]

JavaScript Reference Type

2021 VietMX 0

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 […]

JavaScript Currying

2021 VietMX 0

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 […]

JavaScript Proxy and Reflect

2021 VietMX 0

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 […]

JavaScript Dynamic imports

2021 VietMX 0

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

2021 VietMX 0

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 […]

JavaScript Generators

2021 VietMX 1

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 […]

JavaScript Async/await

2021 VietMX 0

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 […]

JavaScript Microtasks

2021 VietMX 0

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 […]

JavaScript Promisification

2021 VietMX 0

“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 […]

JavaScript Promise API

2021 VietMX 0

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 […]

JavaScript Promises chaining

2021 VietMX 0

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 […]

JavaScript Promise

2021 VietMX 1

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 […]