In this short tutorial, we look at all the methods you could use to create a JavaScript Dictionary. We also look at a few limitations and caveats. If you are new to programming or JavaScript, we recommend you read through the entire article. However,...
Markdown supported · ⌘↵ to post
Ndianabasi Udonkang
Senior Backend Engineer, Cavai Advertising. Full-stack Software Developer
I guess you are coming from a Python background. JavaScript doesn't have a Dictionary type and won't need to have dictionaries because that's what Objects were designed for and more. We don't have to impose a feature from another language on a different language. Rather, you try to study that language and maximise its capabilities
The Object type is so power in JavaScript with tons of methods available to manipulate it. You can easily transform it objects into arrays then into strings.
The object type can also be used for OOP as it can inherit properties from parent objects, define its properties, methods, etc.