2024-07-30
3735
#typescript
Alexander Nnakwue
73729
Jul 30, 2024 â‹… 13 min read

TypeScript string enums, and when and how to use them

Alexander Nnakwue Software engineer. React, Node.js, Python, and other developer tools and libraries.

Recent posts:

featured image tsx extension

What is the difference between a .ts and .tsx file extension?

Examine the differences between the .ts and .tsx file types, their use cases, and best practices for a React TypeScript project.

Hussain Arif
Mar 27, 2025 â‹… 8 min read
How To Use Try...catch For Error Handling In JavaScript

How to use try...catch for error handling in JavaScript

Learn how to use JavaScript try…catch for error handling, including syntax, advanced scenarios, and managing asynchronous code.

Ivy Walobwa
Mar 27, 2025 â‹… 5 min read
Designing For Instant Feedback- The Doherty Threshold In UX

Designing for instant feedback: The Doherty Threshold in UX

The Doherty Threshold suggests that when feedback occurs within this timeframe, users feel more in control and remain engaged.

Chidera Nwankwagu
Mar 26, 2025 â‹… 4 min read
what is pair programming

What is pair programming – and should you try it?

Learn what pair programming is, its benefits, and how real-world implementation can improve your software development process.

Andrew Evans
Mar 26, 2025 â‹… 6 min read
View all posts

2 Replies to "TypeScript string enums, and when and how to use them"

  1. Great article! Helped me a lot.

    I think I found one error:

    // this is same as
    // type direction = ‘UP’ | ‘DOWN’ | ‘LEFT’ | ‘RIGHT’;
    type direction = keyof typeof Direction;

    The comment should be:
    // type direction = ‘Up’ | ‘Down’ | ‘Left’ | ‘Right’;

  2. Hello Matt, yes thanks for the feedback and I’m glad you found the post helpful. We will update the comment as soon as possible. Thanks again

Leave a Reply