To add dictionaries in JavaScript like Python, we can create an object.
For instance, we write
const statesDictionary = {
CT: ["alex", "harry"],
AK: ["liza", "alex"],
TX: ["fred", "harry"],
};
console.log(statesDictionary.AK[0]);
to create the statesDictionary
object that has some keys and values inside.
Then we can access the object’s property values by writing
statesDictionary.AK[0]