Using Maps in JavaScript

info = {
company: "Google",
url: "https://www.google.com",
}
info["CEO"] = "Sundar Pichai"
info["1"] = "inserting a new key/value pair"
info["12"] = "where will this go?"
let infoMap = new Map()
infoMap.set("company", "Google")
infoMap.set("url", "https://www.google.com")
infoMap.set("CEO", "Sundar Pichai")
infoMap.set("1", "inserting a new key/value pair")

--

--

--

Software developer and science/tech writer. Python, Ruby on Rails, JavaScript, React/Redux, Java. Fascinated by the amazing stories behind today’s tech.

Love podcasts or audiobooks? Learn on the go with our new app.

Recommended from Medium

Promise, async, await

Additional fields in the Gutenberg WordPress editor

React Native Local Push Notifications

Use of espeak-ng command in linux

Build a Live Updating App with AWS AppSync Subscriptions

React Native Continuous Deployment

How to Build a Counter Using Redux

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Alyssa Lerner First

Alyssa Lerner First

Software developer and science/tech writer. Python, Ruby on Rails, JavaScript, React/Redux, Java. Fascinated by the amazing stories behind today’s tech.

More from Medium

How Hoisting Works in JavaScript — Variables and Functions

How to Create a Form Reset Button Using Vanilla JavaScript & Bootstrap

Search form with search button and a reset button

JavaScript and Version Controlling

Calculator Function In JavaScript