Is There a way to do an hash map in javascript that holds 1 key and 2 values?
For an hash map with key and value in javascript i can do something like this:
var userList = {
11234321:"koko",
22342342:"jojo",
32342423:"fofo",
42342342:"momo"
}
So for each ID number i have user name.
Now, i want to add another value, like: user age.
There is a way to do that? any other solution to the problem?
I'd recommend having the value as another hash
var userList = {
11234321: {
username: 'koko',
age: 44
}
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With