You're probably talking about an object const hashtable = {}.
In JS, everything is an object (like in Ruby), and here you can store any key/value pair.
Objects are very useful in any occasion unless you just need a single variable or a list (array). Of course I'm not extending to classes and O.
You access object's data using the key you need const age = person.age //or person['age'] and set it's value the same way person.name = "john" //person["name"] = "john".
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
You're probably talking about an object
const hashtable = {}
.In JS, everything is an object (like in Ruby), and here you can store any key/value pair.
Objects are very useful in any occasion unless you just need a single variable or a list (array). Of course I'm not extending to classes and O.
You access object's data using the key you need
const age = person.age //or person['age']
and set it's value the same wayperson.name = "john" //person["name"] = "john"
.