The nullish coalescing operator "??" is a logical operator that returns right-side operand if left side equals to null or undefined, otherwise returns left side. If you're familiar with the logical OR operator, you may wonder what's the difference between it and nullish coalescing operator...Read more
When dealing with complex objects or API responses it is a common thing to access nested properties. In order to make sure the property is reachable without any errors being thrown, we have to make sure each of its parent properties exists...Read more
Due to the fact that objects are reference values in JavaScript, copying them is not as easy as just assigning to another variable. There are a lot of different ways to copy an object. Choosing the right method depends on what would you like to achieve...Read more
Spread operator is used to access all elements inside of an iterable. Don't worry if the definition is not clear, we'll explain the operator in detail...Read more
Destructuring assignment is a special syntax that allows us to retrieve pieces of arrays or objects and assign them to separate variables. This approach can be used for...Read more
Template literals are string literals that allow embedding an expression. It is possible to use string interpolation and multi-line string features with them. In JavaScript, there are 3 ways of defining a string...Read more
These keywords act as a syntactic sugar built on top of Promises, making asynchronous code look and feel like synchronous, therefore easier to produce and maintain. Async function - it is a function, declared using...Read more
Promise - it is an object that produces some value in the future. This object represents the result of an asynchronous operation. Promise has 3 states...Read more
What if we don't only need to check if the given string contains the specific pattern, but get the part of a match? You can easily do so by using so-called capturing groups...Read more