Key/Value Pair
A Key/Value pair is a way to connect data with human friendly names. Often key-value pairs are held within a container. Key value pairs are used everywhere in programming.
first_name = "Zee"
- Defines a ruby variable namedfirst_name
with the value"Zee"
. The key in this case isfirst_name
.{ :first_name => "Zee", :last_name => "Spencer" }
- Defines a ruby hash which contains two key value pairs: key:first_name
with value "Zee" and key:lastname
with value "Spencer".<a href="http://google.com">Search!</a>
- Defines an HTML link which contains a keyhref
with the value"http://google.com"
.