Naming conventions are guidelines or rules used to define the names of variables, functions, classes, and other identifiers in software development. Consistently following naming conventions makes code more readable, understandable, and maintainable across projects and teams. Different programming languages and communities often have their own specific naming conventions. Properties TypeScript supports properties with underscores (_prop), […]
TypeScript
Mastering TypeScript: What’s The Correct Type For setInterval()?
The setInterval() method calls a function at specified intervals (in milliseconds). To cancel an interval, use the id returned from setInterval() method. Here are three solutions to write the setInterval type in TypeScript. Replace <ms> with the number of milliseconds, you want to repeat the execution. Solution #1 Solution #2 Solution #3
Mastering TypeScript: What’s the Correct Type for setTimeout()?
The setTimeout function in TypeScript is used to delay the execution of a function by a specified number of milliseconds. Here are three solutions to write the setTimeout type in TypeScript. Replace <ms> with the number of milliseconds, you want to delay the execution. Solution #1 Solution #2 Solution #3
TypeScript Free Online Course
Welcome to my TypeScript course, designed to provide a learning experience for developers at any level. The course is divided into two main sections. The first section, “Getting Started with TypeScript,” is ideal for beginners, offering a solid foundation in TypeScript basics. If you are an experienced developer, the “Mastering TypeScript” section is for you, […]
Mastering TypeScript: A Free Online Course
This online course is organized into individual articles, each dedicated to the topics of Mastering TypeScript.
Getting Started With TypeScript: A Free Online Course
This online course is organized into individual articles, each dedicated to the topics of Getting Started With TypeScript.
Getting Started With TypeScript: Void Return Type
The void type represents the absence of having any type at all. It’s commonly used to indicate that a function does not return a value. When you declare a function with a void return type, it means that the function doesn’t return anything. Example In this example, the log function takes a message parameter of […]
Mastering TypeScript: Exploring the Void Return Type
Now, we will explore TypeScript’s void return type through two interfaces, ITest1 and ITest2. We’ll examine how it defines functions that don’t return a value and explore potential pitfalls, such as scope issues. Example The ITest1 interface, uses the traditional method declaration syntax for defining methods, whereas the second interface, ITest2, uses an arrow function […]