Strict Types in JavaScript
summary
A short library (≈300 lines, published in Monika on GitHub) adds strict runtime typing to JavaScript without changing TypeScript. It uses Proxy and Symbol.toPrimitive to intercept property reads/writes and forbid binary operations, implements freeze-on-first-assignment (a field’s type is fixed at its first assignment), and deliberately throws errors on mismatches; examples run in the debugger and Node, but no performance measurements are provided.
AI-written summary · about
chapters (8)
- 0:00Introduction
- 3:00Typing problems in JS/TS
- 11:42Prototype chain and constructors
- 23:10Strict typing with Proxies
- 35:18Symbol coercion restrictions
- 44:04Access methods in data structures
- 53:28TypeScript integration
- 1:03:00Q&A
related talks
53m"Strict" JavaScript: Types Versus Reality
25mWhy static types in Javascript? — Preethi Kasireddy
15mJavaScript's Slightly Stricter Mode
01h 11mTypeScript: Static types for JavaScript
21mThe long-tail of type safety
24mTypeScript: Static types for JavaScript
24mTypeScript for JavaScripties
25mStatic types in JavaScript: what, how and why
