The Hero Who Used “any” to Kill All Errors: Reborn with let & const to Master TypeScript!

Time
2025年8月10日 12:00 ~ 12:30
Speaker
kent
Room
TR212
Collaborative Notes
https://hackmd.io/B1vi0qbull
MandarinElementary
JSDC - JavaScript Developer Conferenece Taiwan

Abstract

This talk introduces TypeScript through the lens of JavaScript. Rather than diving into complex syntax like Utility Types or advanced type definitions, we’ll focus on core concepts that are essential when working with TypeScript in native JavaScript contexts. Using progressive examples and real-world beginner mistakes—like the infamous “implicitly has an ‘any’ type” error—we’ll build a solid understanding of type systems and how to design type-safe logic step by step.

Why TypeScript? • Understand the practical benefits of static type checking, autocompletion, and intelligent hints during development.

Where Do Types Come From? (Annotation vs. Inference) • Learn how TypeScript determines types through default parameter examples, and explore the difference between explicit types (type annotations) and implicit types (type inference).

Type Precision and Scope (let vs. const) • Compare let and const declarations to understand type widening (more general types) vs. literal types (narrow, precise values).

Common TypeScript Pitfalls (and JS Misconceptions) • Why inferred types can’t always be reassigned • The difference between immutability and readonly for objects and arrays • Why TypeScript restricts undefined property access • The double-edged sword of as vs. the benefits of as const • The dangers of overusing any—how “AnyScript” leads to unsafe code

About the Speaker

kent

kent

哩賀,我是喜歡問為什麼的前端,目前主要是 React+ Next.js(Pages Router),喜歡參加讀書會。