--

Objects don't provide order, so you might have a navigation menu object like {"home": "/"}; but you can't iterate through that. You could use an array [["home"]:["/"]], but a Map is an alternative (an ordered hashmap).

--

--

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.

No responses yet