How Does TypeScript Types Narrowing Work?

Have you ever heard about TypeScript types narrowing? Have you ever seen such an error in your TypeScript code:

TypeScript complains about "name" property not existing  on "person" object of type "object"

Even tough, you really knew that the name property exists on the person object? How did you solve this problem? Did you cast the variable to the expected type?

If the answer to at least one of those questions is yes, you might read on. There are better ways of determining the type of local variable in TypeScript. What’s more, TS compiler does a lot of stuff for us by leveraging types narrowing. In this article, we are going to see how it works and how it can be useful ?

Most Annoying Digital Nomads Problems

Laptop with skyscrapers in the background

If you’re thinking about working remotely as a digital nomad, Yumasoft is one of the companies allowing that. We leverage remote work to make the most of it, also allowing our employees to travel.

However, as with everything, being a digital nomad has its dark sides. In today’s article, I’m exploring the most annoying digital nomads problems. Read on to be well-prepared for this lifestyle before you decide to take it on! ?