Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

JavaScript Introducing ES2015 Objects and New Collection Types Map

Denis Savenko
PLUS
Denis Savenko
Courses Plus Student 6,994 Points

JavaScript Map is like Python dictionary?

I read about differents javascript object and map, but i came in JS from Python world. Is new javascript map it the same like python dictionary? Maybe they have any difference?

1 Answer

Steven Parker
Steven Parker
231,110 Points

They are similar in many ways. But then, ordinary JavaScript objects are also similar to Python dictionaries in many ways.

But one difference that comes to mind is that maps in JS are always iterated in insertion order. I believe one of the rules of Python dictionaries is they have no reliable order.

Denis Savenko
Denis Savenko
Courses Plus Student 6,994 Points

Thank you for you answer. Yes in Python dictionaries haven't any order. Thank you for this note.