
689: You Should Be Using JavaScript Maps & Sets
About this episode
In this episode of Syntax, Wes and Scott talk about why you should be using JavaScript maps sets, whether you can access them directly, what makes them great, and what weak versions of both are.
Show Notes 00:26 Welcome
01:34 Syntax Brought to you by Sentry
01:54 What makes Maps a spicy buffalo object?
07:46 API of Map
08:51 Looping over items in a Map
09:27 Can you change the size of a map after it’s been created?
10:07 Can you access properties directly?
12:13 Where have we used a map as a cache?
13:32 What makes a set an array honey garlic array?
17:28 When should you be using sets instead of an array?
Proposed Highlight API is built on Sets
21:47 Can you spread sets like an array?
22:40 Weak versions of map and set
WeakMap and Garbage collection
Hit us up on Socials! Syntax: X Instagram Tiktok LinkedIn Threads
Wes: X Instagram Tiktok LinkedIn Threads
Scott: X Instagram Tiktok LinkedIn Threads
More from Syntax - Tasty Web Development Treats
Scott and Wes get into closing the gap between your taste and your skills, with tips on design inspiration, snappier animations and easing. They also share an entry-level setup for recording video les…
Scott and CJ dig into Exact, Expo’s new Rust-based runtime that takes one codebase to web, iOS, macOS and Linux with no React Native involved, plus Bombadil’s property-based testing for web UIs. They…
Scott and Wes sit down with Michael Arnaldi to dig into Effect v4 and why guardrails matter now that AI agents are writing so much of our code. They discuss going zero dependencies, a 5x smaller bundl…
Scott and Wes sit down with GitHub’s Kyle Daigle to ask what the hell is going on with GitHub: the downtime, the agent traffic spike, and the infrastructure overhaul decoupling storage from compute. P…
Wes, Scott, and CJ are back with two weeks of news: Reddit is forcing everyone to log in, r/opensource bans anything AI, and CSS-Tricks is independent again. Plus Anomaly's Hex dictation app, Mitchell…