Key-Value Pair

noun

say it: “KEE VAL-yoo PAIR” /ki ˈvæljuː pɛr/

One entry in a dictionary or hash table: the key you look it up by, and the value stored under it.

What is a key-value pair?

A key-value pair is one entry in a dictionary: the key is what you look it up by (a member's name) and the value is what's stored under it (their number of visits). Keys are unique; setting a key that's already there replaces its value.

In a sentence

  • “Each key-value pair in the gym's dictionary is a member's name and how many times they came this month.”

Level: Apprentice · More Data Structures terms at this level

Updated

In other subjects