#typescript
Read more stories on Hashnode
Articles with this tag
Give an example, we define a Color type: type Color = "primary" | "secondary" | string; Then we use it like this: const color: Color =...
The satisfies operator was Introduced in TypeScript 4.9, which allows you to opt for a different kind of type inference from the default type...
⭐ Typescript enums and why we should avoid them ⭐ In the beginner’s code bases, we often use Typescript enums to store a bunch of constants. export...
⭐ Error Message: “Could Not Find A Declaration File” ⭐ Inside of the index.ts file, we have a single import: import Diff from "diff"; // red squiggly...
⭐ Error Message: “Conversion Of Type X May Be A Mistake” ⭐ We have a Dog interface and a cat object. The Dog interface is defined with a single...
⭐ Error Message: “Property X Has No Initializer” ⭐ We have a User class that contains a private property named username: class User { private...