How to Use Type Casting in Typescript
Too Long; Didn't Read
In TypeScript, something will have an 'unknown` type where TypeScript can't discern the specific type something should be. Casting is necessary for some situations, especially when using querySelector. It's a useful way to enforce certain type restrictions on certain types. The way this code is written is unlikely to happen in the real world, but it could occur if you receive an API response of an unknown type, and have to conform it to a type. TypeScript has a number of predefined types for query selectors, but we can't write `let input: HTMLInputElement =...`