#typescript

Found 32 articles tagged with #typescript

Difference between tuples and arrays in TypeScript

Tuples can store only a fixed number of elements and types at each index, while arrays can store any combination of types and the order is not important.

How to declare array type in TypeScript

Arrays in TypeScript are very similar to JavaScript arrays, but TypeScript provides you with the power of static typing, type inference, and type annotations.

What is TypeScript SQL-like Drizzle ORM?

Drizzle ORM follows the SQL-like syntax whenever possible, and is strongly typed ground up, praised by developers for its simplicity, flexibility and performance.

How to use getters and setters in TypeScript

Getter methods allow you to retrieve the value of a property, while setter methods enable you to modify the value of a property with certain validations or actions.

Jul 09, 2023#typescript

Deep dive into try-catch error types in TypeScript

You can throw any value, but the only type annotations that are allowed on catch clause variables are `any` or `unknown`, which are the most general types in TypeScript.

Jul 04, 2023#typescript#how-to

Object destructuring with types in TypeScript

This syntax allows you to extract properties from an object. You can use it to create variables, assign default values, rename properties, or omit some properties.

Jun 30, 2023#typescript

TypeScript Intersection Types

The new type has all the features of the combined types, and useful when you want to compose or combine types instead of creating them from scratch.

May 18, 2023#typescript

TypeScript Type Guards

They are expressions that perform a runtime check on a value and narrow its type within a conditional block, useful when you want to discriminate between different types of values.

May 18, 2023#typescript

How to extend interfaces in TypeScript

When one interface extends another, it inherits all the members (properties and methods) from the parent interface and can also add its own members or override the ones inherited.

May 17, 2023#typescript#how-to

TypeScript Function Overloading

A way of defining multiple function signatures for a single function implementation. It allows you to specify different combinations of parameter types and return types for a function.

May 17, 2023#typescript