In TypeScript 4.1, apart from a bunch of cool additions, there are four new types that help us better handle various string manipulations. The most common manipulations are: converting the string to uppercase or lowercase, capitalizing and...Read more
In React, state is treated as immutable and should never be modified directly, but either by using a helper function or by overwriting the entire state object with a completely new one. In some cases, this can be frustrating because you have to copy several nested levels of data to change only...Read more
Accessing object properties is a very common operation in JavaScript. In some cases, it is extremely useful to perform an action just after the property is accessed, but before the result is returned, so that the result can be modified on the fly. One of the possible solutions is to create...Read more
In some cases you need to identify whether your application is being viewed from the desktop or mobile device. It might be useful to prevent expensive computations from being performed on mobile devices, as they are not as...Read more
When website users are asked to provide a lot of input, it is important to make sure that the data is not lost if something unexpected happens. One way to ensure this is to store the data somewhere (e.g. in the local storage), so that when the user leaves the page...Read more
Stack is a linear data structure of a LIFO (Last In - First Out) or FILO (First In - Last Out) type, which means that the last element added to the stack is also the first to be taken out. Think of a stack as a constrained array - you can only...Read more
In JavaScript, there are many data structures designed to solve common problems. Knowing them is a must for a good developer to be able to manipulate the data efficiently. Today we will learn about one of the most basic and popular data structures...Read more
Creating a website has never been easier than it is now. There is an enormous amount of tools available for building a website of varying complexity - from a small landing page to a huge web application that processes hundreds of thousands of...Read more
If you are using TypeScript, you might have noticed an Exclamation Mark (!) operator that does some kind of magic and makes your compiler ignore possible errors. Let's learn what the purpose of this operator is and how it can be a useful addition to...Read more