Top "Associative-array" questions

An associative array is an abstract data type composed of a collection of unique keys mapped to a collection of values.

How do I remove objects from a JavaScript associative array?

Suppose I have this code: var myArray = new Object(); myArray["firstname"] = "Bob"; myArray["lastname"] = "Smith"; myArray["age"] = 25; Now if I …

javascript arrays associative-array associative
How to define hash tables in Bash?

What is the equivalent of Python dictionaries but in Bash (should work across OS X and Linux).

bash dictionary hashtable associative-array
Dynamically creating keys in a JavaScript associative array

All the documentation I've found so far is to update keys that are already created: arr['key'] = val; I have …

javascript associative-array
How to check if a specific key is present in a hash or not?

I want to check whether the "user" key is present or not in the session hash. How can I do …

ruby data-structures associative-array
In PHP, how do you change the key of an array element?

I have an associative array in the form key => value where key is a numerical value, however it is …

php arrays associative-array
How to loop through an associative array and get the key?

My associative array: $arr = array( 1 => "Value1", 2 => "Value2", 10 => "Value10" ); Using the following code, $v is filled with $arr's …

php loops associative-array
Java associative-array

How can I create and fetch associative arrays in Java like I can in PHP? For example: $arr[0]['name'] = 'demo'; $…

java hashmap associative-array
Rename a dictionary key

Is there a way to rename a dictionary key, without reassigning its value to a new name and removing the …

python dictionary associative-array ordereddictionary
Adding an item to an associative array

//go through each question foreach($file_data as $value) { //separate the string by pipes and place in variables list($category, $…

php arrays associative-array
Display array values in PHP

So, I'm working with PHP for the first time and I am trying to retrieve and display the values of …

php arrays associative-array