Top "Key-value" questions

A key-value pair is a set of two linked data items: a key which uniquely identifies some item of data, and the value, which is either the data that is identified or a pointer to the location of that data.

How to iterate over associative arrays in Bash

Based on an associative array in a Bash script, I need to iterate over it to get the key and …

bash associative-array key-value bash4
Get selected key/value of a combo box using jQuery

Please, how can I get the selected key and value of a HTML select combo box using jQuery? $(this).find("…

jquery html-select key-value
How can I get key's value from dictionary in Swift?

I have a Swift dictionary. I want to get my key's value. Object for key method is not working for …

dictionary swift key-value
The default for KeyValuePair

I have an object of the type IEnumerable<KeyValuePair<T,U>> keyValueList, I am using var …

c# key-value
How to search if dictionary value contains certain string with Python

I have a dictionary with key-value pair. My value contains strings. How can I search if a specific string exists …

python string dictionary key-value
How to count frequency of characters in a string?

I need to write some kind of loop that can count the frequency of each letter in a string. For …

java string key-value
PHP create key => value pairs within a foreach

I want to create a key-value pairs in an array within a foreach. Here is what I have so far: …

php arrays foreach key-value
Get index of a key/value pair in a C# dictionary based on the value

I would like to know if some property or method exists that gets the index of a specific value. I …

c# dictionary key-value
how to prevent adding duplicate keys to a javascript array

I found a lot of related questions with answers talking about for...in loops and using hasOwnProperty but nothing I …

javascript jquery arrays duplicates key-value
How to add a new object (key-value pair) to an array in javascript?

I have an array as : items=[{'id':1},{'id':2},{'id':3},{'id':4}]; How should I add a new pair {'id':5} to the …

javascript arrays key-value