Exploring the Enigmatic: Navigating JS's Uncharted Realms
summary
Shows concrete patterns: uses Object.defineProperty to set writable/enumerable/configurable, hides per-instance keys with Symbol and warns about Symbol.for leaking, stores private clicked state in a module-scoped WeakMap so the garbage collector clears entries and external code can’t enumerate them, and wraps the exposed API with a Proxy (get/set) plus Reflect helpers to validate sets and return booleans not exceptions. Builds a demo button component that mostly resists casual tampering but can be circumvented if the symbol or original DOM reference is obtained.
AI-written summary · about
chapters (8)
- 0:00Introduction
- 1:10JavaScript property descriptors
- 8:18JavaScript symbols for privacy
- 15:08WeakMap and WeakSet for private data
- 22:03Proxy API for object control
- 27:05Reflect API for meta-programming
- 30:20When to use advanced JS features
- 34:19Q&A
related talks
26mJavaScript Metaprogramming - ES6 Proxy Use and Abuse
11mAnything is possible! Unlocking the Nightmarish Power of JavaScript..
32mBreak all the rules
49mDesign Patterns for Modern Javascript
30m"JavaScript, the Real Bad Parts"
54mPatterns for Programming in JavaScript
54mMetaProgramming with JavaScript
25mDown the Rabbit Hole: JS in Wonderland
