Logo

BLOG

Read thoughts on software development, design, and engineering.

⌘K
Loading posts…

Popular Articles

Enums: When and How to Use ThemTypeScript11 min read

Enums: When and How to Use Them

Enums provide a way to define named constants in TypeScript, making your code more readable and maintainable. Whether you're working with status codes, user roles, or application states, enums help organize related values under a single type. This guide covers numeric enums, string enums, const enums, and most importantly—when to use enums versus alternatives like union types and objects. Learn the patterns that will make your TypeScript code cleaner and more expressive.

#TypeScript#Enums#Type System+4
Read article
Working with Arrays and TuplesTypeScript14 min read

Working with Arrays and Tuples

Arrays and tuples are essential for working with collections in TypeScript. While arrays hold multiple values of the same type, tuples allow you to work with fixed-length arrays where each position has a specific type. This guide covers array types, readonly patterns, tuple best practices, and practical examples that you'll use in real applications. Learn how to leverage TypeScript's type system for safer, more maintainable collection handling.

#TypeScript#Arrays#Tuples+4
Read article
Basic Types in TypeScriptTypeScript14 min read

Basic Types in TypeScript

TypeScript's type system starts with fundamental building blocks: primitive types like string, number, and boolean, along with arrays and type annotations. Understanding these basic types is essential for writing type-safe code. This comprehensive guide walks you through each primitive type, shows you how to use type annotations effectively, and teaches you best practices for working with arrays and basic data structures in TypeScript.

#TypeScript#Types#Type System+4
Read article
Blog — All posts | Joshua R. Lehman Portfolio Site | Joshua R. Lehman Portfolio