meta_pixel
Tapesearch Logo
Log in
Syntax - Tasty Web Development Treats

689: You Should Be Using JavaScript Maps & Sets

Syntax - Tasty Web Development Treats

Wes Bos

Tech News, News, Technology

4.91.2K Ratings

🗓️ 6 November 2023

⏱️ 28 minutes

🧾️ Download transcript

Summary

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

Transcript

Click on a timestamp to play from that location

0:00.0

Monday, Monday, Monday, Monday, open wide Dev fans.

0:04.0

Get ready to stuff your face with JavaScript,

0:07.0

CSS, node modules, barbecue tips, get workflows,

0:10.0

break dancing, soft skills, web development,

0:12.0

the hastyest, the craziest, the craziest, the tastiest, web development

0:16.4

treats.

0:17.4

Coming in hot, here is Wes, Barracuda, Bars, and Scott, El Tor Toroloko Tolinsky.

0:25.0

Welcome to syntax.

0:29.0

On this Monday hasty treat, we're going to be talking by you should be using maps and sets within

0:35.1

JavaScript what they are why they come in handy some of the reasons why they differ

0:40.0

from arrays and objects and just in general what is up with maps and sets my name is

0:45.1

Scott Tolitsky I'm a developer from Denver and with me as always is West Boss

0:49.6

what's up my man hey I thought we should do a show on maps and sets

0:55.9

and how you should use them.

0:57.5

They've been around for, I don't know, probably eight years or so.

1:01.2

It still feels like a relatively new part to JavaScript but in not all

1:06.9

cases but in many cases reaching for a map and a set or a map or a set versus an object or an array can sometimes be a pleasant experience can sometimes be more

1:18.8

performance in your application and yeah there're just great API on them.

1:24.2

So we're going to go through and talk about like how they work as well as like

1:28.6

like use actual use cases that you might want to use them in your applications.

1:33.0

Yeah, they're neat and I don't think they get enough left.

1:36.2

And if you're using any new API like you might be using with maps and sets, you should probably

...

Please login to see the full transcript.

Disclaimer: The podcast and artwork embedded on this page are from Wes Bos, and are the property of its owner and not affiliated with or endorsed by Tapesearch.

Generated transcripts are the property of Wes Bos and are distributed freely under the Fair Use doctrine. Transcripts generated by Tapesearch are not guaranteed to be accurate.

Copyright © Tapesearch 2026.