Blog

Page 447 of my articles, tutorials, and thoughts

Latest Articles

Cover Image for Exclude property from type

Exclude property from type

Published on September 2, 2023

# How to Exclude a Property from a Type in TypeScript So, you want to exclude a single property from a type in TypeScript? 🤔 No worries! I've got you covered! In this blog post, I'll walk you through the common issues and provide easy solutions to help y

Cover Image for The property "value" does not exist on value of type "HTMLElement"

The property "value" does not exist on value of type "HTMLElement"

Published on September 2, 2023

# The Property 'value' does not exist on value of type 'HTMLElement': A Typescript Dilemma 😕 So you're here because you encountered the dreaded error message: "The property 'value' does not exist on value of type 'HTMLElement'". Don't worry, we've got yo

Cover Image for How can I generate a tsconfig.json file?

How can I generate a tsconfig.json file?

Published on September 2, 2023

# 🏭🆕 Generating a `tsconfig.json` file made easy! 🎉📝 So you're struggling with generating a `tsconfig.json` file via the command line? Don't worry, you're not alone! Many developers face this issue when setting up their TypeScript projects. But fear n

Cover Image for Get an object"s class name at runtime

Get an object"s class name at runtime

Published on September 2, 2023

🔥📝💻 *Getting an Object's Class Name at Runtime: TypeScript Magic!* Hey there tech enthusiasts! Have you ever wondered if it's possible to unveil the class name of an object at runtime using TypeScript? 🤔 Well, you're in luck because we're about to div

Cover Image for Typescript Type "string" is not assignable to type
javascript

Typescript Type "string" is not assignable to type

Published on September 2, 2023

🍊🍎🍌 **Hey there, tech enthusiasts!** 📱💻 Are you getting the error message "Type 'string' is not assignable to type 'Fruit'" when trying to assign a string to a variable of custom type Fruit in TypeScript? 🤔 Don't fret! This blog post will guide you

Cover Image for How to watch and reload ts-node when TypeScript files change

How to watch and reload ts-node when TypeScript files change

Published on September 2, 2023

👋 Hey there tech enthusiasts! 👩‍💻👨‍💻 Have you ever wanted to run a development server with TypeScript and an Angular application without having to manually transpile your TS files every time? 🤔 Well, you're in luck! 🍀 In this blog post, we're going

Cover Image for Class type check in TypeScript

Class type check in TypeScript

Published on September 2, 2023

🔍 Class Type Check in TypeScript: Detecting Classes and Interfaces 🔍 Hey there, tech enthusiasts! 👋 Do you find yourself wondering whether it's possible to check if a variable is a certain class or interface in TypeScript? 🤔 You're not alone! Many dev

Cover Image for How to reject in async/await syntax?
asynchronousecmascript-2017

How to reject in async/await syntax?

Published on September 2, 2023

# How to Reject in Async/Await Syntax? 😕 So you've just switched your code from using traditional promise syntax to the shiny new `async/await` syntax. You're feeling pretty good about it, but then you run into a problem - how do you properly reject a pr

Cover Image for How to pass optional parameters while omitting some other optional parameters?

How to pass optional parameters while omitting some other optional parameters?

Published on September 2, 2023

# Passing Optional Parameters with Omitted Parameters Do you struggle with passing optional parameters while omitting others? 🤔 It's a common issue that often leads to confusion and errors. But fear not, because I have some easy solutions for you! In thi

Cover Image for How do I decide whether @types/* goes into `dependencies` or `devDependencies`?

How do I decide whether @types/* goes into `dependencies` or `devDependencies`?

Published on September 2, 2023

# How to decide whether @types/* goes into `dependencies` or `devDependencies`? 🤔 So you're working on a TypeScript project and you want to add typings for a JavaScript library using the `@types` syntax. Great! But you're wondering whether these typings