Tim Mouskhelichvili • June 8, 2022 • 3 minutes to read
The reduce function lets the developer iterate over an array and execute a reducer on each array element. This function returns a single result. Here is a simple example of the reduce function in TypeScript. const arr = [ [...]
Tim Mouskhelichvili • May 7, 2022 • 3 minutes to read
TypeScript adds optional type checking capabilities to JavaScript. Indeed, code written in TypeScript is checked for error before it is executed, saving development and debugging time. One of the potential errors that a developer might encounter is the TypeScript [...]
Tim Mouskhelichvili • May 6, 2022 • 3 minutes to read
In TypeScript, interfaces represent the shape of an object. They support many different features like optional parameters but unfortunately do not support setting up default values. However, you can still set up a TypeScript interface default value by using [...]
Tim Mouskhelichvili • May 4, 2022 • 2 minutes to read
In TypeScript, there could be many scenarios where a developer might want to pause or sleep a function's execution for a specific time. This function used to be hard to implement, but nowadays, promises make it very simple. To [...]
Tim Mouskhelichvili • April 7, 2022 • 7 minutes to read
Functions are part of the basic fundamental concepts of programming that every developer needs to understand. A function is a reusable piece of code that performs a specific task. Functions are the fundamental building blocks of any web application [...]
Tim Mouskhelichvili • March 31, 2022 • 4 minutes to read
In TypeScript, just like in JavaScript, an object contains a set of keys and values. Objects are used to group and pass data to functions. In TypeScript, we represent those objects, with object types, usually interfaces or types. Here [...]
Tim Mouskhelichvili • March 29, 2022 • 3 minutes to read
In TypeScript, just like in JavaScript, the try catch statement is used to handle errors in your code. It consists of three statements: The try statement that defines the code to try (or run). The catch statement that defines [...]
Tim Mouskhelichvili • March 28, 2022 • 4 minutes to read
In TypeScript, both an interface and a type alias can be used to describe a new named type. Since in most cases, almost all features are available in both, developers are sometimes using them interchangeably. This brings confusion and [...]
Tim Mouskhelichvili • March 26, 2022 • 4 minutes to read
In TypeScript, just like in JavaScript, the Set data structure allows the developer to store unique values inside a list. This data structure was first introduced in ES6, just like the map data structure. Here is a basic example [...]
Tim Mouskhelichvili • March 25, 2022 • 3 minutes to read
The forEach function lets the developer iterate over an array and executes a callback function on each element of the array. Here is a basic example of the forEach function in TypeScript. const animals = [ 'dog', 'cat', 'cow' [...]