--

Maps are definitely handy though I've found myself substituting them for arrays more often than for objects. It's fantastic to have a sorted array that you can also look up by id.

I'd mention that I've never seen an actual case where using some other type of Map index than string and also that when I've reached for Map in my interviews it has confused the interviewers more than helped.

--

--

Dr. Derek Austin 🥳
Dr. Derek Austin 🥳

Written by Dr. Derek Austin 🥳

Hi, I'm Doctor Derek! I've been a professional web developer since 2005, and I love writing about programming with JavaScript, TypeScript, React, Next.js & Git.

Responses (1)